jwc1972's Q&A profile
.NET Development How to extract a value from an object in a form of string?
string dts="valueOfX"; int valueOfX=1575; How to use the reflection to extract the value of 1575 if the only object that I get is a string called dts Need some help here pls! I've been reading about reflection but need example pls! Thanks Ahh... that’s why you cannot find dts... it’s not a field of the class but a local variable within a method (in this case the constructor)... try moving them both outside of the constructor and into the class as a whole. ...Show All
Windows Forms Displaying Database information in ListView
I created an address like database with first and last names and include a photo location in the database. Now I want to use ListView to display the photo and name of each row(person) in my database, but I don't know how to retrieve a string from a single cell in my database. can anyone help Try this (pardon me if the DataRow syntax isn't quite right, although I think I got it right ... it's a little different than the syntax for C#): Private Sub Form1_Load( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase .Load 'TODO: This line of code loads data into the 'FirstDatabaseDataSet.Addresses' table. You can move, or remove it, as needed. Me .AddressesTableAdapter.Fill( Me .FirstDatabaseDa ...Show All
Software Development for Windows Vista HBMMENU_CALLBACK in vista
The following code always failed in Windows Vista (Beta 2 Build 5384). It is deemed a completely legimite code and works fine in Windows 2000, XP. Is this a known bug or HBMMENU_CALLBACK is not supported anymore Debugger shows that USER32!ValidateMENUITEMINFO sets the last error code as: LastErrorValue: (Win32) 0x57 (87) - The parameter is incorrect. MENUITEMINFO menuItemInfo = {0}; menuItemInfo.cbSize = sizeof(MENUITEMINFO); menuItemInfo.fMask = MIIM_BITMAP; menuItemInfo.hbmpItem = HBMMENU_CALLBACK; ATLVERIFY( SetMenuItemInfo(hMenu, ID_FILE_NEW, FALSE, &menuItemInfo) ); Any leads or information would be appreciated. Thanks In Vista July CTP Build 5472, it still fails. Seems like it ha ...Show All
.NET Development How to dynamically change connection string in generated dataset class?
I have a project with database classes which are generated from database objects. That is I add a dataset to the project and drag and drop a database object onto it. The problem with this is that I have to give a connectionstring which is stored in the code. This is ok while developing the application. But runtime I want to use another connectionstring, both for security reasons and because each user of the application will correspond to a database user (ms sql) and shall have a corresponding connectionstring. Is there an easy way to do this without having to restore to plain all datasets and do everything myself gdexter wrote: I want to use your solution for this frustration problem... Code you post the Fake Settings co ...Show All
Visual C# Is interop.shdocvw.dll redistribuable?
Hi, I'm using interop.shdocvw.dll (strong named with tlbimp) in my application. I would like to know if I can redistribuate this dll with my application (which is a commercial product). I haven't been able to find anything 'official' about this :-( Does anyone know the answer And could possibly give me a link on an official Microsoft page saying that That would be great! Thank you very much, Thibaud As long as the components, methods and properties you are actually calling from your code haven't changed, then the interop assembly generated on your machine will work regardless of the precise version of shdocvw.dll on the target machine. And if any of those things have changed (which is very unlikely) then ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Game freezes every few seconds
Hi, Every few seconds my game freezes and then resumes. The time of the freezes varies depending on debug/release or if i am debugging in visual studio. Also, when i run in debug mode with debugging sometimes* the program freezes permanently. But if i put a breakpoint in, it breaks, then when i continue it works fine. Its wierd. I am using threads for parts of my program but im certain my code is fine. Are there any bugs with regard to threads and freezing in xna help please. "I am using threads for parts of my program but im certain my code is fine." How are you certain this is fine Your problem sounds like the threads are in contention. This would be caused you have your threads acce ...Show All
Smart Device Development Breakpoint will not currently be hit in smart device DLL
I am trying to debug a C# .Net Compact Framework 1.0 application for Pocket PC using Visual Studio 2005. The application is made up of a number of DLL projects. All the projects are set to Debug, and they all deploy to the device fine. When I debug the application I can set breakpoints in all the classes except those in one particular project. Breakpoints are not hit in this project, and when I am stepping in other classes that use objects from that particular project, the debugger says "Could not evaluate expression" What I find even weirder is in the debug output it says "Symbols loaded" for that particular DLL, but in the Modules window the DLL is not listed. Even though the debug output indicates it is loaded and t ...Show All
Windows Forms Binding a datasource to combobox
I have a ComboBox in my application that is bound to a BindingList through the DataSource property. I am monitoring the SelectedIndexChanged event of the combobox for selection changes made by the user. My problem is that i want the ComboBox to have an empty selection (nothing selected) initially, however upon setting the DataSource property to the BindingList the ComboBox automatically changes selection (from empty) to the first item in the BindingList. Selection also changes (if there is nothing selected) when items are deleted or added to the BindingList (once its bound to the ComboBox). Is there anyway of disabling this behaviour any help would be much appreciated. Don't you have a re ...Show All
SQL Server Problem when a IS tries to move data between servers
Hello, I have a problem: I have created an Integration Services in SQL Server 2005 that moves data from a table in a server to another table in another server. I have set the protection level property to "don't save sensitive". The problem is when I try to execute it with a dtexec command. I get this errors: 'An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80040E4D Description: "Communication link failure".' 'An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80040E4D Description: "TCP Provider: An existing connection was forcibly closed by the remote host.' 'An OLE DB record is available. Source: "Microsoft SQL Native Clie ...Show All
Visual Studio 2008 (Pre-release) Why is XAML Serialization sandboxed?
Why is XamlWriter.Save() sandboxed Am I understanding correctly that this is a limitation of the implementation and not security related It's very frustrating to have a nice way to capture the layout of a Canvas an store it, but find it doesn't work for XBAPs. Any other suggestions Sorry, yes XamlWriter can't be used in Partial Trust in v3. We hope to enable this in the future after a full security model review. Thanks for raising the issue. You could try to see if writing compiling your own XamlWriter (see my code from this post ) into your xbap would work. Please let us know how that goes. Thanks, Rob Relyea Program Manager, WPF Team http://rrelyea.spaces.live.com ...Show All
Visual C# Comma in an agument of a console application.
Hi All, I have written a console application in C# and it works fine except for the following: I want to pass as an argument an expression that has commas in it, in my case a user distinguished name for and active directory or nds tree (i.e.: cn=myUser,ou=apps,ou=services,o=myOrg) but wnat it to be treated as one piece. The app doesn't look at this as a single string but as 4. How would we type in the argument as on piece, bearing in mind that there could be different user dns with more or less hierarchy (# of commas) Is there a way to escape commas in a dos window Thanks, BIG I believe you want to wrap the whole thing in quotes: MyProg.exe "cn=myUser,ou=apps,ou=services,o=myOrg" THe CLR ...Show All
SQL Server Columns_Updated () and Update() functions
Hello all, I'm trying to apply an audit DB trigger on a master-detail tables ,I do not need to insert record in the audit master every time an update happend in the audit detail,I tried to use columns_updated() > 0 but it didn't work the way I axpected it to be ..it stopped inserting into the audit master even if an update was applied against the master table ...any help please and I use the Update() function is their any major difference your help is appreciated Thanks Alaa M COLUMNS_UPDATED() returns a value as a VARBINARY datatype, so for your comparison to work you need to convert the value to an INT first, like this: CAST ( COLUMNS_UPDATED () AS INT ) Chri ...Show All
Visual Basic What Installer to Use to Distribute VB Application
I'm new to programming and have just completed an application I'd now like to distribute to folks for testing. Can someone please recommend an installer application (either free or payware) I can download to package the application for installing on someone elses computer Thanks for your time! Doug I'm using VB 2005 in Visual Studio 2005. I understand that I can publish and/or deply out of VB but when the application installs from the CD it loads it to some obscure directory buried under my username in Documents and Settings. I want the application to install in Program Files like most other applications. How can I make that happen Doug ...Show All
Game Technologies: DirectX, XNA, XACT, etc. C#: Error with code, but no errors shown in the dev enviro.
For some reaon i get errors with two pieces of code in my project. I get an error that says "InvalidDataException was Unhandled" "error in application" in this piece of code: #region Using directives using System; using System.Drawing; using Microsoft.DirectX.Direct3D; #endregion namespace TheLegendOfZelda { public class Picture : IDisposable { public Picture( string fileName, Color colorKey) { (at this line the error appears to be) ImageInformation imageInformation = TextureLoader .ImageInformationFromFile( Game .PicturesPath + fileName); m_Width = imageInformation.Width; m_Height = imageInformation.Height; m_Texture = TextureLoader .FromFile( Ga ...Show All
SQL Server Convert RS2005 rdl to RS2000
Hi, Is there any tool that can convert a report definition language file written for RS2005 to be compatible with RS2000 Any help will be appreciated. Thank you. Peter Microsoft does not provide a RDL-downgrade tool. Not sure if anyone else has built one and made it available to the public. Anyway, it would not be difficult to build a tool yourself, or just follow the manual steps described in this thread: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=414302&SiteID=1 The manual steps cover almost 100% of RDLs (I omitted custom report item and custom properties). -- Robert ...Show All
