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
Marco Lopez
NA
1
0
Put Data from a table to a label
Aug 23 2010 6:00 PM
Hello, i have this code
Saludos, tengo el siguiente codigo.
SqlDataSource sds = new SqlDataSource();
sds.ConnectionString = ConfigurationManager.ConnectionStrings["DatabaseConnectionString2"].ToString();
sds.SelectParameters.Add("username", TypeCode.String, this.username.Text);
sds.SelectParameters.Add("password", TypeCode.String, this.password.Text);
sds.SelectCommand = "SELECT * FROM [Descuentos] WHERE [ID_DIM] = @username AND [Password] = @password";
DataView dv = (DataView)sds.Select(DataSourceSelectArguments.Empty);
try
{
if (dv.Count == 0)
{
this.lblinfo.ForeColor = System.Drawing.Color.Red;
this.lblinfo.Text = "Numero de DIM o Password incorrecto!";
return;
}
The Table has the next Values: ID_DIM, Nombre, Descuento and Password, i make a comparation between the DIM and Password in the database (user and pswd), now i need the "Descuento" (discount) value into a label, to make an arithmetic operation.
For example, if i am the DIM number 5689, and i have the 35% of discount, put the 35% into the label to make the operation.
any suggestion i will apreciate it (by the way, sorry about my english).
Reply
Answers (
1
)
check file size
Event log Writer