dafan's Q&A profile
SQL Server Escape a SQL string programmatically?
I need to construct a SQL statement programmatically and must escape strings included as values to follow SQL rules. For example: command.CommandText = "INSERT INTO Table (strColumn) VALUES('" + EscapeSQLChars(badChars) + "')"; command.ExecuteNonQuery(); Is there a built-in .Net command that does what I want EscapeSQLChars to do Use paramitrimized queries. Then you never have to worry about format's or SQL Injection. It's olso better for the preformance, because you don't need to have to concatenate a string for example: string query = "SELECT * FROM Table1 WHERE ID = " + txtId.Text + " ...Show All
Windows Forms Remote Server Issues
I'm having a weird issue problem unzipped server source and client source. Created a Solution with TaskVisionWS TaskVision Xpander Chart Microsoft.Application.Blocks Compiled solution, and ran it. IIS on Local Machine – SQL on Local Machine Runs fine it’s actually pretty good. When I moved the DB to my Dedicated Sql Server (Windows Enterprise Server 2003) and move the Web Service to my ...Show All
Visual Studio Team System WebProxy for webtest tests and view browser when running coded tests
hi there, I am new to having a look at the web test product and only have the Bet 2 at the moment (long story)... A couple of questions: 1. How do you set a webproxy for the webtest tests. I have set the username and password under the credentials tab but this just results in a 407 Proxy Authentication Required. I can do it in the coded version with the following NetworkCredential credential; credential = ( NetworkCredential ) CredentialCache .DefaultCredentials; WebProxy proxy = new WebProxy ( "XX.XX.XX.XX" , 80); proxy.Credentials = credential; this .WebProxy = proxy; How do I do this through the webtest interface 2. When I ru ...Show All
SQL Server No Default SQL Instance on Install?
Problem: When the application installs it requires SQL Express Server 2005. If it does not exist it will install it or rollback. -> continue installation -> When the form attempts to locate an SQL Instance on a machine that has not had SQL server or any components connected before it shows up as <null>. I need to have access to the server(s) instances in order to build the application database inside SQL. Am I using the wrong approach with SQLDMO Is there adifferent method to access the installed SQL Express 2005 connection string Current code to locate SQL Instances: try { ////////////////////////// ...Show All
.NET Development Attribute Values in XML File
Hello, I have a XML File with an attributevalue like this: <mark text="Tlakoměr"/> When I open this XML File in VB.NET 2005 Express, I get the following values for this attribute: XMLElement.ChildNodes(Count1).Attributes("text").InnerXml "Tlakom r" XMLElement.ChildNodes(Count1).Attributes("text").OuterXml "text="Tlakom r"" XMLElement.ChildNodes(Count1).Attributes("text").InnerText "Tlakom r" XMLElement.ChildNodes(Count1).Attributes("text").InnerXml "Tlakom r" XMLElement.ChildNodes(Count1).Attributes("text& ...Show All
Visual FoxPro return from a form.
Still struggling to communicate with some of my secondary forms. This problem, again, happens only in StartMode = 4. Everything is fine interactively. LOCAL cUserReturn AS String DO FORM <formName> WITH par1, par2 TO cUserReturn. I get an error message that there is operand/operator type mismatch. I tried to define cUserReturn as Variant - the same thing. The expected type of return is String . According to the Help FoxPro is supposed to create a return variable when it is not defined. I tried to leave it undefined only to get another message: cUserReturn not found. Catch-22. I suspect there is something here I do not kn ...Show All
Visual FoxPro Form clattered at design time. How to change pages?
With many controls added to a form I am beginning to sense a problem. During runtime many controls will be invisible on the first page but when subsequent pages are chosen they will appear. It is determined programmatically. I do not see an option to choose pages at design time. It would allow me to see some controls much better. In Visual dBASE Plus such convenience if taken for granted and much appreciated. How can I do it here Thanks. Hi Alex, Just to make sure you understand, Forms don't have Pages, PageFrames do. If you want Pages then you need to add a Pageframe control to your Form. PageFrames are container objects that contain ...Show All
Visual C# Where did my smart tags go?
Hi, I love the Shift+Alt+F10 smart tag feature for implementing interfaces and absract classes. But I noticed that all of a sudden I can't bring up the smart tag any more. I see the little prompt and tooltip telling me to press Shift+Alt+F10, but when I do so nothing happens. I think it started happening when I installed the latest LINQ Preview, but I'm not positive. I have since uninstalled the preview, but still no smart tags. Is there anything I can do to bring them back, short of a reinstall Thanks, John This is a known Issue for with Linq, lot of others have faced the same problem. I am linkin ...Show All
Visual Studio Any AddIn not loading
I'm trying to get at developping a small addin for VS2005 but I can't get it (or any other addin from msdn samples or somewhere else on the web) to load. I tried launching/debugging the FileNav sample that comes from MSDN. I set it up correctly (so the .addin/.dll get outputed to <My Document>\Visual Studio 2005\Addin) and I launch it correctly using msdev.exe with the appropriate command line option. However, the OnConnection method never gets invoked and, as you would expect, the addin doesn't appear in the add-in manager. I also tried installing other addins from the web (CoolCommands v3 for example) and they don't launch in VS for ...Show All
.NET Development Help!!! Command line interaction
I'm working in a project/Form where i use a "Graphic Line Interface" exe, called "7z.exe" (used to compress/decompress data files). This Form is used to show path, file type, compression level and so on... When i try to decompress a file with password, i need to pass this password to the console, but before this action, i have to verify if the program is asking this password. Its where i have the problem, because when the "7z.exe" process is being executed, i can't acced to the window to extract the last line where is writen "Enter Password:". This problem appears to be just in this program, because when i tried to simulate in a small ...Show All
Visual C# How can I store settings in the registry for the current user only?
Hello, I think the title says it. Please help. ...Show All
Visual C++ How do i stop any program that i run from exiting almost immediately.
Hi! I am experiencing difficulties while using the Microsoft Visual C++ 2005 Express Edition: Any program that i write, upon pressing start to run it, would automatically end itself almost immediately, giving me no time to see the output. Is there any way to delay the programs from exiting (Any settings that i should change ) Thank you. Regards, Ebenezer Thank you all for taking the time to read my post and answering. =) Regards, Ebenezer ...Show All
Visual Basic Help with Calender
Hi I'm really new to programing and am having trouble with a feature of an application i am writing. I need a callender where the user can select a date and another form will popup with space to enter text i then want this to be saved so that when the same date is selected from the calender again it will open up the window with text. As i said I am very new to programing and any help or code will be appreciated. Tris I'm learning for fun well trying to learn i seem to be getting around it slowly. my text box is called textbox1 and I changed .txttextdata with textbox1 and it says its not declared. you ...Show All
Windows Forms Error Handling when calling a webservice
How do you handle errors in an XML webservice and consume it correctly in a windows client For example, if I use a webservice to update a database via a dataadapters update method, I pass the web service a dataset (changed rows only), use the update method to updated the database, return the changed rows with refreshed information (e.g. identity values&nbs ...Show All
Windows Forms DataSet.WriteXML vs. Access DB (Jet)
We have a typed DataSet that we were originally going to load with data using Jet and an Access DB for a new standalone project. This has worked fine for us in the past. We just discovered we could save our DataSet to an XML file very easily by calling WriteXML and then load just as easily. This would save some time getting& ...Show All
