我正在尝试从数据库中的表中获取单个值。 存储时,它们都被赋予唯一的ID。 这是我用来放入的代码:
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这样你就可以了解我在寻找什么,我不是在寻找sql语句,我不知道如何使用它们。
请记住,这都是vb.net/asp.net。
谢谢!
- 编辑 -
我想我找到了一些有用的东西,但我找不到如何使用它。 选择功能。 它返回一些东西,并接受像我上面提到的插入参数......任何想法?
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 WithThat 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/asp.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?
最满意答案
如果没有先运行SQL查询来提取它,就无法提取它。
如果您已经掌握了这一点,请在MS帮助页面中进一步了解如何运行选择查询,这是您放置SQL语句的地方。
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.
更多推荐
发布评论