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
Mfwamba Tshimanga
NA
155
45.8k
Textbox don't show numeric datas only character one...
May 22 2014 4:33 AM
Hi!
I have these code and when I make filter its show me data in my textbox (only character one. Not numeric one). How can I resolv it please?
This is the structure of my database:
Name Data Type
First_name Varchar(30)
Code numeric(18,0)
{
string connectionString = @"Data Source=localhost\sqlexpress;Initial Catalog=master;Integrated Security=True";
SqlConnection sqlCon = new SqlConnection(connectionString);
sqlCon.Open();
string commandString = "select first_name, code from company where code='" + codesearch.Text + "'";
SqlCommand sqlCmd = new SqlCommand(commandString, sqlCon);
SqlDataReader read = sqlCmd.ExecuteReader();
while (read.Read())
{
showfirstname.Text = read["first_name"].ToString();
// Here it's right
showcode.Text = read["code"].ToString();
// The problem it's here
}
sqlCon.Close();
}
Reply
Answers (
3
)
Crystal Syntax Program (Crystal Reports)
How To get data from database into datatable ?