Click here to Skip to main content
15,906,333 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
public class myCommon
{
     public static sqlConnection = new csSQL = sqlConnection("myconnectionString)";
}

and your consuming code would look somthing like:
C#
private void frmDemo_Load(object sender, EventArgs e)
{
     this.Text = myCommon.csSQL;
}
Posted
Updated 6-Jul-11 3:57am
v4
Comments
fjdiewornncalwe 6-Jul-11 9:53am    
What is your question. You haven't asked us anything.
ayolilo 6-Jul-11 10:00am    
i want to know where im going wrong with my code

This is the solution of your problem

C#
public static class myCommon
{
     public static sqlConnection = new csSQL = sqlConnection("myconnectionString)";
}
 
Share this answer
 
Create a static class
Tanvtech
 
Share this answer
 
Comments
ayolilo 6-Jul-11 10:03am    
ok ill try that
ayolilo 7-Jul-11 9:05am    
ive tried that but it doesnt recognize the varible on my login code

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900