Jason Steeves wrote:
-Dim cmd As OleDbCommand
-cmd = New OleDbCommand("select * from qmsstats where
firstname='jason'", OleDbConnection1)
-OleDbDataAdapter2.SelectCommand = cmd
-DataGrid1.Visible = True
-OleDbDataAdapter2.Fill(DsQmsStats1)
-DataGrid1.DataBind()
In the above example I need to change 'jason' to a variable. I need
the variable to be pulled from a textbox. IE: txtusername.text.
Please advise how I can get the value from txtusername.text in place
of 'jason'.
There was no way for you to know it, but this is a classic asp newsgroup.
While you may be lucky enough to find a dotnet-savvy person here who can
answer your question, you can eliminate the luck factor by posting your
question to a newsgroup where the dotnet-savvy people hang out. I suggest
microsoft.public.dotnet.framework.aspnet.
You need to use a parameter marker, "?", and use the OleDbCommand's
parameters collection to pass the value from the textbox to the parameter
marker. If you have Visual Studio, you can look these concepts up in online
help. If not, go to msdn.microsoft.com/library and search for "parameter
queries" or "parameter markers"
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.