try the following code from this post. http://blog.miseldine.com/?p=24
privatestaticvoid ExecuteSql(SqlConnection ___conn, string ___fileName)<br />
//array for storage of SQL<br />
string __sqlStatements;<br />
//the only clever bit: spilt at each GO statement<br />//as the normal SQL connector will spit out anything<br />//after the GO.<br />
Regex __r = new Regex("^GO", RegexOptions.Multiline);<br />
//for file reading: just replace with the string of<br />//SQL if not from file. Or embed SQL as resource…<br />
StreamReader __sr = new StreamReader(___fileName);<br />
string __sql = __sr.ReadToEnd();<br />
__sqlStatements = __r.Split(__sql);<br />
SqlCommand __comm = new SqlCommand();<br />
__comm.Connection = ___conn;<br />
//loop through each block in the spilt SQL and<br />//execute.<br />foreach (string __sqlBlock in __sqlStatements)<br />
if (__sqlBlock.Trim().Length > 0)<br />
__comm.CommandText = __sqlBlock;<br />
catch (SqlException)<br />
//here, execute your DROP script<br />break;<br />
thks to original author.
here is another one... http://msdn2.microsoft.com/en-us/library/ms811086.aspx
You can make its installer by creating a setup project in Visual Studio. Or you can add another project of type Setup Wizard in the same solution which is a bit easier way. Then there is InstallShield which you could use. There are many many ways to create an installer.
On google, search how to create setup projects in Visual Studio.
i have a class A. Class B derives class A and class C derives from class B and class D derives from class c. Now i need to call a method of class A from class D. is it possible? if so how can i acheive this. Is there any facility in C# that helps me to call the methods any of the classes A, B, C from class D? very urgent
I know very well what inheritance is. Here my problem class A has a method Method1 and Class B inherits class A and Class C inherits class B where Class C overides the Method1 and class D inherits class C. know when i call Methodi from class D the Method1 of class C will be called. but i want to call the Method1 of class A. We can use super keyword in C++. is there any thing in C# that helps us to acheive this? got this time you got it?
I am currently coding some small-scale automation tools for my department and have been running into some issues as I am a beginner to Win32 coding.
I need to read and parse the text from another application's StatusStrip. I am assuming it's a StatusStrip as sending either an SB_GETTEXT or WM_GETTEXT message to the control's handle retrieves nothing. However, it may be a custom control as getting the child windows of this control only returns a handle to a StatusBar Progress Bar control.
I am hoping that it is not a custom control and I am just missing some reason as to why the ToolStripStatusLabels are not showing up as children of the StatusStrip control.
I have also been having issues trying to read from a ListView in this app, but I believe it's a custom control as well because I have no issues reading from another app's ListViews by virtually allocating memory and all of that jazz.
I do know that the app I'm having difficulty with uses a lot of the newer .Net controls that the other app's don't.
So, if anyone has any insight as to how I would retrieve the text from another app's StatusStrip, I would be extremely grateful.