Login
Register
Tutorials
Forum
Career Development
Resources
Reviews
Jobs
Interview
Communities
Projects
Training
Silverlight Games
|
Bookmarks
|
New Members FAQ
|
Mentor
|
Code Converter
|
IT Companies
|
Peer Appraisal
|
Members
|
Revenue Sharing
|
Computer Jokes
|
New Posts
|
Social
|
Talk to Webmaster Tony John
Online Members
naveensanagasetti
mohanraj
prasad
sunil kumar sharma
More...
Forums
»
.NET
»
.NET
»
by using empcode can we get the ename automatically
Posted Date:
04 Mar 2008
Posted By::
swathi
Member Level:
Gold
Member Rank:
0
Points
: 2
Responses:
1
hi
i have entered empcode ,ename and deisgnation in database
suppose if i enter empcode automatically ename should be displayed in the textbox
Tweet
Responses
#197827 Author:
silpa
Member Level:
Gold
Member Rank:
0
Date: 04/Mar/2008 Rating:
Points
: 2
Hi
Suppose if you have a combo box with empcode values from the database.
Then you canwrite as
SqlConnection con = new SqlConnection("Give the connection string");
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;//con is SqlConnection
con.Open();
SqlDataReader dr;
cmd.CommandText = "select ename from emp where empcode='+combobox1.text;
dr = cmd.ExecuteReader();
dr.Read();
TextBox1.Text=dr[0].ToString();
Post Reply
This thread is locked for new responses. Please post your comments and questions as a
separate thread
.
If required, refer to the URL of this page in your
new post
.
Tweet
Next :
Same Error Plz how execute this querry
Previous :
XML Details
Return to Discussion Forum
Post New Message
Category:
Related Messages
Is there any expert to solve this?
what is difference between String and string(data type) in c#?
what is a resource file...
Horizontal Scroll Bar for a listview control
sql querry
Active Members
Today
Ultimaterengan
(7)
Padma
(6)
Sucharitha Gou...
(5)
Last 7 Days
baskar
(312)
naveensanagase...
(183)
Asheej T K
(163)
more...
Awards & Gifts
Email subscription
.NET Jobs
.NET Articles
.NET Forums
Articles Rss Feeds
Forum Rss Feeds