First of all .. excuse me for my poor English, I hope they understand you.
I regularly work with LINQ, new SQL for me.
I am trying to do the following: I have the following method in C #:
public string niceMethod() { SqlConnection connection = new SqlConnection("Data Source=*******;Integrated Security=False;"); string commandtext = "SELECT bla FROM items WHERE main = 1"; SqlCommand command = new SqlCommand(commandtext, connection); connection.Open(); string tDate = (string)command.ExecuteScalar(); connection.Close(); return tDate; }
I have a page, for example: items.aspx?nID=144
how can i do that the SELECT command will be with querystring and this will take the value
from the "items" table by identifier (nID) displayed at?
The table has a design, for example: id, title, bla, main.
source share