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 Data displayed in textboxes with the help of Combobox?
Sep 17 2009 6:55 AM
Hello,
Please help!!!
I am working in C#.I have a form that a combo box and Three Text box.The combo box contains Item codes. when i select a item code in combo box then related data (Item Name,price,Quantity) is displayed in three text boxes.But i get only one value in textboxs. plz solve my problem.My code past here.
private
void
comboBox2_SelectedIndexChanged(
object
sender,
EventArgs
e)
{
string
s;
s = comboBox2.ToString();
cn =
new
SqlConnection
(System.Configuration.
ConfigurationManager
.AppSettings[
"con"
]);
SqlCommand
cmd=
new
SqlCommand
(
"select column003,column005,column007 from CATABLE004 where column002='"
+ s +
"'"
,cn);
da2 =
new
SqlDataAdapter
();
ds =
new
DataSet
();
cmd.Connection = cn;
da2.SelectCommand = cmd;
da2.Fill(ds,
"CATABLE004"
);
textBox2.Text = comboBox2.SelectedValue.ToString();
textBox3.Text = comboBox2.SelectedValue.ToString();
}
Reply
Answers (
4
)
how to Data displayed in textboxes with the help of Combobox?
How to show all first sunday in grid from the range of two date