Click here to Skip to main content
15,914,109 members
Home / Discussions / C#
   

C#

 
GeneralRe: IOExpection error using Streamreader and FileStream Pin
Harvey Saayman21-Sep-08 4:00
Harvey Saayman21-Sep-08 4:00 
GeneralRe: IOExpection error using Streamreader and FileStream Pin
yefeng_law21-Sep-08 7:24
yefeng_law21-Sep-08 7:24 
AnswerRe: IOExpection error using Streamreader and FileStream Pin
zafersavas21-Sep-08 0:59
zafersavas21-Sep-08 0:59 
Questionhow to crate an class from the xsd Pin
prasadbuddhika20-Sep-08 18:47
prasadbuddhika20-Sep-08 18:47 
AnswerRe: how to crate an class from the xsd Pin
Mirko198024-Sep-08 4:16
Mirko198024-Sep-08 4:16 
Questionnewbee question Pin
Rafone20-Sep-08 16:08
Rafone20-Sep-08 16:08 
AnswerRe: newbee question Pin
Caio Kinzel Filho20-Sep-08 16:28
Caio Kinzel Filho20-Sep-08 16:28 
GeneralRe: newbee question Pin
Rafone20-Sep-08 16:56
Rafone20-Sep-08 16:56 
sure. This works fine from my form

private void connectToolStripMenuItem_Click(object sender, EventArgs e)
{
// connect to the database
// define connection string
strConn = "Data Source=localhost;IntegratedSSPI;
"+ "Initial Catalog=myDB";
strSQL = "SELECT * FROM myTable";
SqlDataAdapter da = new SqlDataAdapter();
cn = new SqlConnection(strConn); // connect to SQL
//-------- Define a new Dataset ----------
DataSet ds = new DataSet();
//-------- Define a new DataAdapter ----------
da = new SqlDataAdapter(strSQL, cn);// connect the data adapter
//-------- fill the DataAdapter ----------
da.Fill(ds, "dsPoints");
//-------- Assign the DataSet to the DataGrid ----------
dgv1.DataSource = ds;
dgv1.DataMember = "dsPoints";
}

I would like to have the button click on the form just call this code as a module say like this

private void connectToolStripMenuItem_Click(object sender, EventArgs e)
{
getData()
}

The coding of C# I'm catching on to but the mechanics of how the pieces connect together (outside of the form)are what has me hosed up.
I would like to be modulerized...can't really find good reference on concepts plenty of content though.

any help or suggestions are greatly appreciated.
TIA
Rafone

Statistics are like bikini's...
What they reveal is astonishing ...
But what they hide is vital ...
GeneralRe: newbee question Pin
Caio Kinzel Filho20-Sep-08 17:52
Caio Kinzel Filho20-Sep-08 17:52 
GeneralRe: newbee question Pin
Rafone20-Sep-08 18:34
Rafone20-Sep-08 18:34 
GeneralRe: newbee question Pin
Caio Kinzel Filho20-Sep-08 22:52
Caio Kinzel Filho20-Sep-08 22:52 
AnswerOT Pin
Harvey Saayman20-Sep-08 21:28
Harvey Saayman20-Sep-08 21:28 
QuestionCustom DataGridViewCell data binding question. Pin
Bliedtke20-Sep-08 15:49
Bliedtke20-Sep-08 15:49 
AnswerRe: Custom DataGridViewCell data binding question. Pin
Bliedtke21-Sep-08 10:19
Bliedtke21-Sep-08 10:19 
QuestionExtract certain text from a html page. Pin
Buckleyindahouse20-Sep-08 13:31
Buckleyindahouse20-Sep-08 13:31 
AnswerRe: Extract certain text from a html page. Pin
Jan Sommer20-Sep-08 23:43
Jan Sommer20-Sep-08 23:43 
GeneralRe: Extract certain text from a html page. Pin
Buckleyindahouse21-Sep-08 3:24
Buckleyindahouse21-Sep-08 3:24 
GeneralRe: Extract certain text from a html page. Pin
Jan Sommer21-Sep-08 3:40
Jan Sommer21-Sep-08 3:40 
GeneralRe: Extract certain text from a html page. Pin
Buckleyindahouse21-Sep-08 6:21
Buckleyindahouse21-Sep-08 6:21 
AnswerRe: Extract certain text from a html page. Pin
Bliedtke21-Sep-08 10:35
Bliedtke21-Sep-08 10:35 
GeneralRe: Extract certain text from a html page. Pin
Bliedtke21-Sep-08 10:39
Bliedtke21-Sep-08 10:39 
AnswerRe: Extract certain text from a html page. Pin
Bliedtke21-Sep-08 11:48
Bliedtke21-Sep-08 11:48 
QuestionHow can I access to an item in a solution folder ? Pin
Mohammad Dayyan20-Sep-08 11:32
Mohammad Dayyan20-Sep-08 11:32 
AnswerRe: How can I access to an item in a solution folder ? Pin
Caio Kinzel Filho20-Sep-08 14:55
Caio Kinzel Filho20-Sep-08 14:55 
GeneralRe: How can I access to an item in a solution folder ? Pin
Mohammad Dayyan21-Sep-08 3:35
Mohammad Dayyan21-Sep-08 3:35 

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.