Click here to Skip to main content
16,011,870 members
Home / Discussions / C#
   

C#

 
GeneralRe: DataGrid Display Pin
Abhijit Jana21-Oct-07 19:02
professionalAbhijit Jana21-Oct-07 19:02 
GeneralRe: DataGrid Display Pin
Member 387988121-Oct-07 19:04
Member 387988121-Oct-07 19:04 
GeneralRe: DataGrid Display Pin
Abhijit Jana21-Oct-07 19:07
professionalAbhijit Jana21-Oct-07 19:07 
GeneralRe: DataGrid Display Pin
kabutar21-Oct-07 20:25
kabutar21-Oct-07 20:25 
GeneralRe: DataGrid Display Pin
kabutar21-Oct-07 20:31
kabutar21-Oct-07 20:31 
GeneralRe: DataGrid Display Pin
Abhijit Jana21-Oct-07 20:48
professionalAbhijit Jana21-Oct-07 20:48 
GeneralRe: DataGrid Display Pin
kabutar21-Oct-07 22:51
kabutar21-Oct-07 22:51 
GeneralRe: DataGrid Display Pin
Abhijit Jana22-Oct-07 3:32
professionalAbhijit Jana22-Oct-07 3:32 
Thanks for Explining,

I am asuming your database has Roll, Name , Address , Marks fields

And Create a Load_Grid() Function on form_load()

Load_Grid()
{
Load data to grid();
}
Now see, in your datagrid there may be multiple records ? is it ?

Now read the key value from that row, and pass the value in the next form.

Supoose u select row 2 and roll=5, pass this to form 2, u can easily access the controls of other form just creating the object and access.

Now in Form2,
There is Three Text box,

Roll : txtroll
Name: txtName
Address : txtAddress

Now,
SQLCommand cmd=new sqlcommand("select * from student where roll='_RollVal',conn) // _RollVal is passed value
SqlDataReader dr=new Sqldatareader();
dr= cmm.executenonquery();
now u can get the value
txtRoll.Text=dr[0].text
txtName.Text=dr[0].text
Now change the vale in text box, and on click on UpdateButton .... Update database [ Just use Update Command to Update] and back to the Form1..... , and all refresh data will come to you grid, cause , load_grid() will call on Form Load.Cool | :cool: Cool | :cool:


Hope You like This..... And for any query ask me Wink | ;)


Good luck Smile | :)






Happy Programming
-----------------
Abhijit Jana
Noida, India

GeneralRe: DataGrid Display [modified] Pin
kabutar22-Oct-07 5:13
kabutar22-Oct-07 5:13 
GeneralRe: DataGrid Display Pin
Abhijit Jana22-Oct-07 18:36
professionalAbhijit Jana22-Oct-07 18:36 
GeneralRe: DataGrid Display Pin
kabutar22-Oct-07 19:06
kabutar22-Oct-07 19:06 
GeneralRe: DataGrid Display Pin
Abhijit Jana22-Oct-07 20:31
professionalAbhijit Jana22-Oct-07 20:31 
GeneralRe: DataGrid Display Pin
kabutar22-Oct-07 20:41
kabutar22-Oct-07 20:41 
GeneralRe: DataGrid Display Pin
Abhijit Jana22-Oct-07 20:45
professionalAbhijit Jana22-Oct-07 20:45 
GeneralRe: DataGrid Display Pin
kabutar22-Oct-07 21:44
kabutar22-Oct-07 21:44 
QuestionHow to use IOfficeAntiVirus Pin
jason_mf21-Oct-07 16:47
jason_mf21-Oct-07 16:47 
AnswerRe: How to use IOfficeAntiVirus Pin
Ajay.k_Singh21-Oct-07 21:23
Ajay.k_Singh21-Oct-07 21:23 
QuestionAbstract class implementing interface [modified] Pin
SeeBees21-Oct-07 15:32
SeeBees21-Oct-07 15:32 
AnswerRe: Abstract class implementing interface Pin
PIEBALDconsult21-Oct-07 15:48
mvePIEBALDconsult21-Oct-07 15:48 
GeneralRe: Abstract class implementing interface Pin
SeeBees21-Oct-07 17:57
SeeBees21-Oct-07 17:57 
GeneralRe: Abstract class implementing interface Pin
mav.northwind21-Oct-07 19:21
mav.northwind21-Oct-07 19:21 
GeneralRe: Abstract class implementing interface Pin
SeeBees21-Oct-07 20:07
SeeBees21-Oct-07 20:07 
GeneralRe: Abstract class implementing interface Pin
PIEBALDconsult22-Oct-07 11:24
mvePIEBALDconsult22-Oct-07 11:24 
QuestionGetting IE or Firefox to automatically open the file Pin
Brad Wick21-Oct-07 15:12
Brad Wick21-Oct-07 15:12 
AnswerRe: Getting IE or Firefox to automatically open the file Pin
PIEBALDconsult21-Oct-07 15:51
mvePIEBALDconsult21-Oct-07 15:51 

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.