Click here to Skip to main content
15,881,248 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to cast unknown object? Pin
Tesic Goran10-May-11 20:27
professionalTesic Goran10-May-11 20:27 
QuestionNeed concept regarding website visit tracking software c# Pin
Tridip Bhattacharjee9-May-11 21:35
professionalTridip Bhattacharjee9-May-11 21:35 
AnswerRe: Need concept regarding website visit tracking software c# Pin
ambarishtv9-May-11 22:56
ambarishtv9-May-11 22:56 
AnswerRe: Need concept regarding website visit tracking software c# Pin
Eddy Vluggen10-May-11 0:36
professionalEddy Vluggen10-May-11 0:36 
AnswerRe: Need concept regarding website visit tracking software c# Pin
Dave Kreskowiak10-May-11 1:17
mveDave Kreskowiak10-May-11 1:17 
QuestionMaskedTextBox for IP address entry sample? Pin
9ine9-May-11 20:56
9ine9-May-11 20:56 
AnswerRe: MaskedTextBox for IP address entry sample? Pin
Blue_Boy9-May-11 21:00
Blue_Boy9-May-11 21:00 
QuestionWhere to keep the public variables & Functions? VS2010 Pin
Paramu19739-May-11 2:37
Paramu19739-May-11 2:37 
Iam using vs2010. And I need to access my sql table in various places. For that in VB2008 I used by modules. But in C# I don't know where to keep the below codes in a place and how to access it from various forms... The code look like below...

public string ConStr_1 = "Data Source=2.2.1.90; initial Catalog=MyDatabse; User Id=abcd; Password=1234";
public System.Data.SqlClient.SqlConnection Con = new System.Data.SqlClient.SqlConnection();
public System.Data.DataTable MyTbl = new System.Data.DataTable();
public System.Data.SqlClient.SqlDataAdapter MyDAp = new System.Data.SqlClient.SqlDataAdapter();
string My_Qry = "Select * from MyTable";

public void MyTblCollection()
{
Con.ConnectionString = ConStr_1;
Con.Open();
MyDAp = new SqlDataAdapter(My_Qry, Con);
MyDAp.Fill(MyTbl);
Con.Close();
}

Hence where to add these code for further access with all other forms.[same like module in vb]
ThanksThumbs Up | :thumbsup:
AnswerRe: Where to keep the public variables & Functions? VS2010 Pin
PIEBALDconsult9-May-11 2:43
mvePIEBALDconsult9-May-11 2:43 
GeneralRe: Where to keep the public variables & Functions? VS2010 Pin
Luc Pattyn9-May-11 2:51
sitebuilderLuc Pattyn9-May-11 2:51 
GeneralRe: Where to keep the public variables & Functions? VS2010 Pin
PIEBALDconsult9-May-11 3:01
mvePIEBALDconsult9-May-11 3:01 
QuestionRe: Where to keep the public variables & Functions? VS2010 Pin
#realJSOP9-May-11 8:18
mve#realJSOP9-May-11 8:18 
AnswerRe: Where to keep the public variables & Functions? VS2010 Pin
PIEBALDconsult9-May-11 14:40
mvePIEBALDconsult9-May-11 14:40 
AnswerRe: Where to keep the public variables & Functions? VS2010 Pin
Luc Pattyn9-May-11 2:49
sitebuilderLuc Pattyn9-May-11 2:49 
GeneralRe: Where to keep the public variables & Functions? VS2010 Pin
PIEBALDconsult9-May-11 3:13
mvePIEBALDconsult9-May-11 3:13 
AnswerRe: Where to keep the public variables & Functions? VS2010 Pin
#realJSOP9-May-11 8:15
mve#realJSOP9-May-11 8:15 
GeneralRe: Where to keep the public variables & Functions? VS2010 Pin
SilimSayo9-May-11 11:38
SilimSayo9-May-11 11:38 
GeneralRe: Where to keep the public variables & Functions? VS2010 Pin
PIEBALDconsult9-May-11 14:14
mvePIEBALDconsult9-May-11 14:14 
GeneralRe: Where to keep the public variables & Functions? VS2010 Pin
SilimSayo11-May-11 6:30
SilimSayo11-May-11 6:30 
GeneralRe: Where to keep the public variables & Functions? VS2010 Pin
PIEBALDconsult11-May-11 14:31
mvePIEBALDconsult11-May-11 14:31 
AnswerRe: Where to keep the public variables & Functions? VS2010 Pin
Shameel9-May-11 18:10
professionalShameel9-May-11 18:10 
GeneralRe: Where to keep the public variables & Functions? VS2010 Pin
Paramu197310-May-11 0:12
Paramu197310-May-11 0:12 
QuestionSpace in a c# wordAddIn project Pin
Pierre besquent9-May-11 0:43
Pierre besquent9-May-11 0:43 
Questionkdtele disconnect problem Pin
mobasher8-May-11 23:22
mobasher8-May-11 23:22 
AnswerRe: kdtele disconnect problem Pin
Dave Kreskowiak9-May-11 1:23
mveDave Kreskowiak9-May-11 1:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.