x.P.e.r.t F.M.'s Q&A profile
Visual C# Casting via Reflection?
I have a container.DataItem object which can be an instance of any one my data objects. In my method a field name is passed where I need to get the value from the field name in that data object. Since at run-time I don't know which data object that is I have to figure it out and then get the value from field whose name was passed in. This is what I think I should do but GetValue() takes an object which is already cast to the correct type but I don't know the correct type at run-time. Type bill = (container.DataItem).GetType(); FieldInfo field = bill.GetField(@"__billStatusCode").GetValue( ); So how can I cast (container.DataItem) to the correct object type via reflection or some other way Izz ...Show All
SQL Server Standby, this is a test post, thanks for your patience
I just have to try this. ...Show All
Visual Studio Team System VSTestHost
Hi, Does anyone know if it is possible to start the VSTestHost from a VS 2005 project using the debug Properties option 'Start external program'. (I set the argument to the test script dll.) I need to do this to collect code coverage using DevPartner, but when I start the Code Coverage Analysis, the execution just stops after a couple of secs Any help or tips appreciated. Thanks, Nell Hi Nell5, I don't think that will work. Have you tried running your tests with the command-line interface The executable to run is called mstest.exe. Open a VS Command Prompt and type mstest / for options. Also, have you investigated collecting code coverage with the built in tools we have in VST ...Show All
Windows Forms CRM 3.0 sample senario
dear all I want real senario to implement it as a practice The official website: http://www.microsoft.com/dynamics/crm/default.mspx . Could you explain a little bit ...Show All
Visual Studio Express Editions VC# control library template
I'd like to create a usercontrol in VC# 2005 Express Edition and then add this control to the toolbox. I've been looking for info on the net and it seems I need the "control library template". Is this correct And if so, why dosen't this template appear in the supplied templates 1. Step: Create your own class library, add a user control to it and then compile it. 2. Step: RightClick inside your toolbox -> Choose Items 3. Step: Browse for the *.dll file and add it ...Show All
Smart Device Development Not Able to see Solution name in Solution Explorer.
Hi All, I am facing a strange problem. whenver i add new windows project or solution in visual studio 2005 , i am not able to see complete tree strucrure in solution explorer. The tree structure starts from C# windows application's name rather than solution name. Ideally, whenever we add any new project in the studio we see solution name at the root elemet of tree structure but this is not the case with me. Though i am able to see solution name while adding new website but not in the case of windos application. This all resulting in another problem that i can't add another project to the same solution because i can't see the solution name in the solution explorer. can any one please help me on this. Thanks & Regards, - ...Show All
Visual C++ Every combination help
Hey guys i am making a pq therom program. I am to the part where i have a[20]/b[20]. I need to do every possible combination like a[1]/b[1] and a[1]/b[2] and so on. What can i do so i get this. I need all the answers in another array. Hello Re question: Every combination help Such questions are outside the scope of this forum - for the scope of the VC General forum please look at: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=19445&SiteID=1 For such issues please use the newsgroups at http://msdn.microsoft.com/newsgroups . OTP Thanks Damien ...Show All
Windows Forms New Unable to view designer in vs2005 c#
Hi! More or often less systematicly I get an error message when I try to view my forms in the Designer. It seems to be related to form which inherits from a baseform which again inherits from Form. It worked fine until 1 1/2 week ago. Then I should continue working on an old form in project. This form gave an error message instantly and suddenly ALL of my forms (inherited from my baseform) was unable to see in the Designer. I have tried making new projects, solutions, forms. Seems to start good but at some point they all get the same redline errormessage. This is VERY frustrating and timeconsuming. The whole customerproject will suffer from this unexpected problem. I have found no ice-breaking info on the net. The thread with almo ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Trouble with Game.ElapsedTime
I'm writing a variable-timed game and am having trouble with ElapsedTime. As I understand it, it is supposed to be the amount of time that has elapsed since Update() was last called. It usually returns reasonable values, but occasionally it returns negative numbers, or numbers that are > 10x what I would expect. I have a very fast game loop and if I just assume 1ms for the timing, I get a perfectly smooth game, but if I rely on ElapsedTime, the game is jerky. I know that my game loop never takes negative time so those have to be bogus values (don't they ). I also think the > 10x values are bogus since the game is smooth when I ignore them and assume 1ms loops. Does anyone have any ideas why ElapsedTime would act this way Tha ...Show All
Visual Studio Team System CTP7: Schema Comparison - Icon Color of greyed out items
A user performs a schema comparison. He selects "skip" of an item, which had been marked "Drop". The icon in front of the text Drop is a red cross. After selecting this item to be skipped, the label "Drop" changes it's color to gray, but the color of the icon is still vibrant red. This is - in my opinion - not optimal. The color of the icon should - in my opinion - change too, eg to gray, or to a much less vibrant red. Can you please file a bug through http://connect.microsoft.com/ . We will look at it after V1. - Sachin Kumar ...Show All
Smart Device Development sqlceDataReader.Read Error please help
Hello there, I am looking to find out if I can get some help on an issues with the sqlceDataReader.Read mehtod in Visual Studio .NET 2005 Before I give you the snippet of code, I am going to give you all the background information as needed: Platform: Symbol MC50 using Windows Mobile 2003 Programming Platform: Visual Basic .NET 2005 Server Database Platform: SQL Server 2000 (Has SQL Server 2005 Mobile Edition Server Tools installed) Mobile Database: SQL Server 2005 Mobile Edition using Merge Replication Here is the background of the project. We have a barcode application that scans UPC barcodes of products and returns the basic product infromation. So all it does is reference data within a database. We orginally developed our c ...Show All
SQL Server How to split a transaction table to create training and testing set for AR
Hi all, I have a transaction table that has a composite key made up of transaction id and product id. where multiple products were purchased under same transaction, transaction ids got repeated. I would like to split the table randomly into 70%, 30% ratio to create training and testing set respectively in such a way that it does not split a same transaction under which multiple products were purchased (rows with same transaction id should not get split). is it possible if possible what is the idea It would be of great help. Thanks. Fakhrul Hello There is a sample posted on sqlserverdatamining.com ( http://sqlserverdatamining.com/DMCommunity/TipsNTricks/4048.aspx ) that shows how to samp ...Show All
SQL Server compare fields from two datasets
Hello, How can I solve this problem. For example, I have two databases. db1 and db2. I want to compare two float fields from tables from db1 and db2 and the present the difference between these fields in a column in reporting services. ex. loop1 value from db1.table_db1 4 value from db2.table_db2 6 diff 2 ex. loop2 value from db1.table_db1 2 value from db2.table_db2 2 diff 0 ..continues... Should I create 2 datasets and 2 datasources Must I write custom code for this Regards Are the two databases on the same server or on the different servers If they are on the different servers then use the SQL Server linked servers feature. ...Show All
Visual Basic Custom control problem
This may well show my idiocy but here goes. I decided to build a custom control using visual basic in Visual studio 2005. I created a control library and built a control by dragging a Text Control from the tool bar. I managed to add the properties I wanted and modified the key down and key press events to accomplish what I wanted. The idea was of course to have this custom control available in many areas in a project. I then added the control library to the visual basic windows project. I am able to select the control from the toolbar in the project and add it to forms in the project. This all works (the control works as designed). The problem I have is when I add code to say the got focus event of the control in the project th ...Show All
Visual C# Convert DataTable to html table without DataGrid
Hi, Does anyone has a routine to convert a DataTable to html code I can't use datagrid, cause I will add more html to it... Thanks Well, first of all, you need to "add more html to it" could probably be satified by using a DataGrid and capturing the ItemDataBound event. Or you could use Template columns. Or use a DataList control or a Repeater control. ...Show All
