Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
balamreddy
Starting Member
2 Posts |
Posted - 2010-12-17 : 13:59:18
|
hiHelp me in the above caseTo print the max value on the label by getting it from database table.Kindly the code to be used is C#. |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-12-17 : 14:07:13
|
I must say that you are very clear... No, you're never too old to Yak'n'Roll if you're too young to die. |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2010-12-17 : 18:17:35
|
[code]select max([value]) from [database table][/code]CODO ERGO SUM |
|
|
balamreddy
Starting Member
2 Posts |
Posted - 2010-12-18 : 00:45:24
|
how can i get that max value into a label using c#quote: Originally posted by Michael Valentine Jones
select max([value]) from [database table] CODO ERGO SUM
|
|
|
Sachin.Nand
2937 Posts |
Posted - 2010-12-18 : 02:04:29
|
Use a command object of C#.Something like thisSqlCommand cmd = new SqlCommand(sql, conn);where sql is the actual query to get the max value from the table and conn is the connection string.Then set the value of the label to value returned from the command object.label.text=Convert.ToString(cmd.ExecuteScalar) PBUH |
|
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2010-12-18 : 03:08:27
|
Seriously now. Read over what you posted and imagine that you know nothing about the scenario. Can you really figure out what's been asked? Why do you think we can?--Gail ShawSQL Server MVP |
|
|
DonAtWork
Master Smack Fu Yak Hacker
2167 Posts |
Posted - 2010-12-22 : 11:51:56
|
OP simply read some of Peter's replies where Peter did his mind reading act, and OP assumed OP could get an answer also. http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspxHow to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspxFor ultra basic questions, follow these links.http://www.sql-tutorial.net/ http://www.firstsql.com/tutor.htm http://www.w3schools.com/sql/default.asp |
|
|
|
|
|