开发者

Getting out a single value from a sql database (asp.net)

开发者 https://www.devze.com 2023-02-21 01:29 出处:网络
I\'m trying to get a single value from my table in a database. They are all given a unique id when stored. Here is the code I use to put the in:

I'm trying to get a single value from my table in a database. They are all given a unique id when stored. Here is the code I use to put the in:

With SqlDataSource1
   .InsertParameters("page").DefaultValue = ViewState("TrueURL")
   If My.User.IsAuthenticated Then
      .InsertParameters("sender").DefaultValue = My.User.Name
   Else
      .InsertParameters("sender").DefaultValue = Request.UserHostAddress.ToString
   End If

   .InsertParameters("details").DefaultValue = PrepareText(TextBox2.Text)
   .InsertParameters("date").DefaultValue = Now()
   .Insert()
End With

That was so you could get an idea of what I was looking for, I'm not looking for sql statements, I don't know how to use them.

Just keep in mind, this is all vb.net/a开发者_StackOverflow中文版sp.net.

Thanks!

--EDIT--

I think I found something useful but I can't find how to use it. The Select function. It returns something and accepts parameters like the insert one I mentioned above... any ideas?


You cant extract it without first running an SQL query to extract it.

If you've got this far, read a little further in the MS help pages about how to run the select querys, this is where you would put your SQL statements.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号