Click here to Skip to main content
15,904,339 members
Home / Discussions / C#
   

C#

 
Questionhow to get present item from generic list using c# Pin
ramyanaidu9-Dec-07 23:59
ramyanaidu9-Dec-07 23:59 
AnswerRe: how to get present item from generic list using c# Pin
Anthony Mushrow10-Dec-07 0:09
professionalAnthony Mushrow10-Dec-07 0:09 
AnswerRe: how to get present item from generic list using c# Pin
CKnig10-Dec-07 0:58
CKnig10-Dec-07 0:58 
Generalupdates on stored procedure does not appear on dataset Pin
subai9-Dec-07 23:48
subai9-Dec-07 23:48 
GeneralSwitching Internet connections Pin
new2pgrmg9-Dec-07 23:47
new2pgrmg9-Dec-07 23:47 
Generalproblem with propertygrid Pin
Deglimmer9-Dec-07 23:43
Deglimmer9-Dec-07 23:43 
GeneralRe: problem with propertygrid Pin
visualhint13-Dec-07 11:36
visualhint13-Dec-07 11:36 
Generalproblem to load Data from form2 to form1.gridView Pin
hdv2129-Dec-07 23:32
hdv2129-Dec-07 23:32 
hi in my app, i have two forms, in form1, i have a button and gridview and a public method as 'LoadData' as follow :
public void LoadData()<br />
        {<br />
            using (SqlConnection con = new SqlConnection("Data Source=server;Initial Catalog=northwind;User Id=sa;Password=1;"))<br />
            {<br />
                SqlCommand cmd = new SqlCommand("select * from customers", con);<br />
                SqlDataReader dr;<br />
                DataTable dt = new DataTable();<br />
                con.Open();<br />
                dr = cmd.ExecuteReader();<br />
                dt.Load(dr);<br />
                con.Close();<br />
                this.gridControl1.DataSource = dt.DefaultView;<br />
            }<br />
        }


in button_click event, i show form2 as follow :
private void simpleButton1_Click(object sender, EventArgs e)<br />
        {   <br />
            Form2 frm = new Form2();<br />
            frm.Show();<br />
        }

in form2, i have only one button, i want when i click this button, create object from form1 and calling LoadData() method to fill gridView as follow :
private void simpleButton1_Click(object sender, EventArgs e)<br />
        {<br />
            Form1 frm = new Form1();<br />
            frm.LoadData();<br />
        }

but in runTime, when i click button in form2, gridView does not fill, i trace my app and i saw frm.LoadData() was correctly work but gridView does not fill, where does my problem and how to solve it ?
thanks
GeneralRe: problem to load Data from form2 to form1.gridView Pin
CKnig10-Dec-07 1:10
CKnig10-Dec-07 1:10 
GeneralRe: problem to load Data from form2 to form1.gridView Pin
hdv21210-Dec-07 2:50
hdv21210-Dec-07 2:50 
GeneralRe: problem to load Data from form2 to form1.gridView Pin
CKnig10-Dec-07 2:56
CKnig10-Dec-07 2:56 
Generalchecking for a _ Pin
eyeseetee9-Dec-07 23:07
eyeseetee9-Dec-07 23:07 
GeneralRe: checking for a _ Pin
Bekjong9-Dec-07 23:24
Bekjong9-Dec-07 23:24 
GeneralRe: checking for a _ Pin
eyeseetee9-Dec-07 23:52
eyeseetee9-Dec-07 23:52 
GeneralDOM in C# Pin
Yoyosch9-Dec-07 22:45
Yoyosch9-Dec-07 22:45 
Generalchecking for a value Pin
eyeseetee9-Dec-07 22:40
eyeseetee9-Dec-07 22:40 
GeneralRe: checking for a value Pin
Bekjong9-Dec-07 23:22
Bekjong9-Dec-07 23:22 
GeneralC#.NET windows services Pin
D i x y9-Dec-07 22:39
D i x y9-Dec-07 22:39 
GeneralRe: C#.NET windows services Pin
Bekjong9-Dec-07 23:31
Bekjong9-Dec-07 23:31 
GeneralRe: C#.NET windows services Pin
Ujjaval Modi10-Dec-07 0:13
Ujjaval Modi10-Dec-07 0:13 
GeneralRe: C#.NET windows services Pin
CKnig10-Dec-07 0:31
CKnig10-Dec-07 0:31 
GeneralRe: C#.NET windows services Pin
DaveyM6910-Dec-07 1:41
professionalDaveyM6910-Dec-07 1:41 
Generalc# windows control fails to load in the webpage Pin
Naveen Gowda9-Dec-07 22:13
Naveen Gowda9-Dec-07 22:13 
GeneralRe: c# windows control fails to load in the webpage Pin
Paul Conrad10-Dec-07 10:31
professionalPaul Conrad10-Dec-07 10:31 
GeneralRe: c# windows control fails to load in the webpage Pin
RichardGrimmer11-Dec-07 5:46
RichardGrimmer11-Dec-07 5:46 

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.