Click here to Skip to main content
15,904,153 members
Home / Discussions / Database
   

Database

 
Questiondate & time can you saparate them ?? Pin
Mohammed Amine8-May-06 13:10
Mohammed Amine8-May-06 13:10 
AnswerRe: date & time can you saparate them ?? Pin
Daniel Santillanes9-May-06 13:10
professionalDaniel Santillanes9-May-06 13:10 
GeneralRe: date & time can you saparate them ?? Pin
Mohammed Amine10-May-06 4:01
Mohammed Amine10-May-06 4:01 
QuestionHow to Add Two dataSets Data ************* Urgent Pin
Rupesh Shivarkar8-May-06 7:51
Rupesh Shivarkar8-May-06 7:51 
QuestionMSDE is not running Pin
K. narasimharao7-May-06 18:48
K. narasimharao7-May-06 18:48 
QuestionIs it worth learning SQL server 2k now? Pin
CoolAmir7-May-06 13:18
CoolAmir7-May-06 13:18 
AnswerRe: Is it worth learning SQL server 2k now? Pin
Rob Graham7-May-06 14:22
Rob Graham7-May-06 14:22 
QuestionPass value from dropdownlist to SQL select using SelectedIndexChanged? Pin
FionaDM7-May-06 5:37
FionaDM7-May-06 5:37 
I want to pass a(numerical) value from a dropdownlist to an SQL select using the DropDownList SelectedIndexChanged event.

Here's my code so far.

protected void MyDropDownList_SelectedIndexChanged(object sender, EventArgs e)
{
DropDownList MyDropDownList = (DropDownList)("MyDropDownList");
MyLabel.Text = MyDefinitionDropDownList.SelectedItem.Value.ToString();


string strSQL;

strSQL = "SELECT COUNT(*) as count from MyTable where ID= ???";


}


My problem is that I don't know what should replace the '???'. I've tried

strSQL = "SELECT COUNT(*) as count from MyTable where ID= MyLabel.Text";

but this is interpreted as "SELECT COUNT(*) as count from MyTable where ID= MyLabel.Text"
even though my debugger tells me MyLabel.Text is grabbing an OK value.

If I do strSQL = "SELECT COUNT(*) as count from MyTable where ID= 6" for example it works fine.

I think my problem is with casting?

Thanks

Majella
AnswerRe: Pass value from dropdownlist to SQL select using SelectedIndexChanged? Pin
Rob Graham7-May-06 6:01
Rob Graham7-May-06 6:01 
GeneralRe: Pass value from dropdownlist to SQL select using SelectedIndexChanged? Pin
FionaDM7-May-06 22:12
FionaDM7-May-06 22:12 
Questionsql Pin
naidu nagam7-May-06 0:43
naidu nagam7-May-06 0:43 
AnswerRe: sql Pin
Rob Graham7-May-06 6:18
Rob Graham7-May-06 6:18 
QuestionFullTextSearch and Arabic Words Pin
TheEagle6-May-06 22:56
TheEagle6-May-06 22:56 
AnswerRe: FullTextSearch and Arabic Words Pin
Rob Graham7-May-06 6:04
Rob Graham7-May-06 6:04 
GeneralRe: FullTextSearch and Arabic Words Pin
TheEagle7-May-06 6:56
TheEagle7-May-06 6:56 
GeneralRe: FullTextSearch and Arabic Words Pin
Rob Graham7-May-06 7:08
Rob Graham7-May-06 7:08 
GeneralRe: FullTextSearch and Arabic Words Pin
TheEagle7-May-06 7:14
TheEagle7-May-06 7:14 
GeneralRe: FullTextSearch and Arabic Words Pin
Rob Graham7-May-06 7:19
Rob Graham7-May-06 7:19 
GeneralRe: FullTextSearch and Arabic Words Pin
TheEagle7-May-06 7:24
TheEagle7-May-06 7:24 
GeneralRe: FullTextSearch and Arabic Words Pin
TheEagle7-May-06 16:55
TheEagle7-May-06 16:55 
GeneralRe: FullTextSearch and Arabic Words Pin
Rob Graham7-May-06 17:24
Rob Graham7-May-06 17:24 
GeneralRe: FullTextSearch and Arabic Words Pin
Rob Graham7-May-06 17:45
Rob Graham7-May-06 17:45 
GeneralRe: FullTextSearch and Arabic Words Pin
TheEagle8-May-06 6:17
TheEagle8-May-06 6:17 
Questiondatetime Comparision Pin
DotNetDominator6-May-06 18:52
DotNetDominator6-May-06 18:52 
AnswerRe: datetime Comparision Pin
Rob Graham7-May-06 5:23
Rob Graham7-May-06 5:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.