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 display the information in gridview when item selected in combobox?
Sep 7 2009 7:20 AM
hi,
iam working in windows application in C#.if i select one item in combobox then immediatly that item information is displayed in gridview?how? i tryied but it is not working.my codeing past bellow.
private
void
comboBox1_SelectedIndexChanged(
object
sender,
EventArgs
e)
{
string s;
s = comboBox1.Text.ToString();
cn =
new
SqlConnection
(System.Configuration.
ConfigurationManager
.AppSettings[
"con"
]);
SqlCommand
cmd =
new
SqlCommand
(
"select * from CATABLE001 where column005=(select column001 from CATABLE005 where
column002='@COLUMN002'
)"
, cn);
da2 =
new
SqlDataAdapter
();
ds =
new
DataSet
();
cmd.Connection = cn;
da2.SelectCommand = cmd;
da2.Fill(ds,
"CATABLE001"
);
dataGridView1.DataSource = ds.Tables[0];
}
plz help me
thanx
himanshu
Reply
Answers (
1
)
how to interact asp.net application with external devices
How do you remotely connect to SQL Server Express Editions?