Tech
Forums
Jobs
Books
Events
Live
Interviews
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
6
Reply
How to retrieve data from database to Gridview when i Doubleclick a particular cell using C#?
roy himanshu
Sep 10 2009 2:21 AM
7k
Reply
hi,
How to retrieve data from database to Gridview when i Doubleclick a particular cell using C#
.i past my code bellow,plz help me
private
void
Form3_Load(
object
sender,
EventArgs
e)
{
cn =
new
SqlConnection
(
"data source=server2;database=costing1;user id=sa;password=sa"
);
da =
new
SqlDataAdapter
(
"select *from CATABLE001 where 1=2"
, cn);
ds =
new
DataSet
();
da.MissingSchemaAction =
MissingSchemaAction
.AddWithKey;
da.Fill(ds,
"CATABLE001"
);
dataGridView1.DataSource = ds.Tables[0];
private
void
dataGridView1_DoubleClick(
object
sender,
EventArgs
e)
{
int
sno =
int
.Parse(
Interaction
.InputBox(
"Enter ItemCode"
,
"db operations"
,
""
, 50, 50));
DataRow
dr = ds.Tables[
"CATABLE001"
].Rows.Find(sno);
dataGridView1.DataSource = ds.Tables[
"CATABLE001"
];
}
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
6
)
Next Recommended Forum
All objects created in a class referance the same object?
deleting row in mysql from datagridview