TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
roy himanshu
NA
126
0
How to retrieve the selected item data from database to Gridview using C#.
Sep 10 2009 8:24 AM
How to retrieve the selected item data from database to Gridview using C#
.i past my code bellow,plz help me
private
void
dataGridView1_DoubleClick(
object
sender,
EventArgs
e)
{
cn =
new
SqlConnection
(
"data source=server2;database=costing1;user id=sa;password=sa"
);
da2 =
new
SqlDataAdapter
(
"select *from CATABLE001 where column002='@column002'"
, cn);
ds =
new
DataSet
();
da2.MissingSchemaAction =
MissingSchemaAction
.AddWithKey;
da2.Fill(ds,
"CATABLE001"
);
cmd =
new
SqlCommand
();
cmd.Connection = cn;
cmd.CommandType =
CommandType
.StoredProcedure;
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"
];
Reply
Answers (
2
)
Combobox strictly from the list
{"Cannot find central directory"}