Monday, March 26, 2012

Passing LinkButton text value as Sql Query parameter!

Hi,

Could you inform me programmatically how can I pass LinkButton text value as Sql Query parameter?Big Smile

I tried the

1command.CommandText ="SELECT DISTINCT [Description] FROM [Projects] WHERE ([Type] = " & SqlDbType.Text = LinkButton12.Text &")" 
but it does not work!!! 
 Thanks in advance!!!!

Try changing the line to this:
command.CommandText = "SELECT DISTINCT [Description] FROM [Projects] WHERE ([Type] = '" & LinkButton12.Text & "')"
The statement "SqlDbType.Text = LinkButton12.Text" probably evaluated to a boolean which threw off your query.|||Ok,thank you very much ZeroDefinition...Smile

No comments:

Post a Comment