Re: ASP.NET Querying a database
- From: "Siva M" <shiva_sm@xxxxxxxxxxxxxxxxx>
- Date: Sat, 23 Jul 2005 00:25:37 +0530
Use <asp:ControlParameter> in the .aspx page. In the code-behind,
SqlDataSource.SelectParameters collection.
"Mark Thomson" <@@@> wrote in message
news:OxMjbxujFHA.1412@xxxxxxxxxxxxxxxxxxxxxxx
In my .aspx file i have:
<form runat="server">
<asp:GridView ID="GridView1" DataSourceID="SqlDataSource1"
runat="server"/>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
SelectCommand="select authorname from authors where authorid = authorid"
ConnectionString="<%$ ConnectionStrings:Pubs %>" />
</form>
I have this code to run a query on the database.
The trouble is I don't know how to embed an authorid which is in my textbox
into the query.
in my .aspx.cs file i have:
protected void getAuthor_Click(object sender, EventArgs e)
{
}
How can i change the query so that i embed the authorid that i have got from
my textbox ?
.
- Prev by Date: Re: button and post back
- Next by Date: Re: button and post back
- Previous by thread: button and post back
- Next by thread: Share a printer on a remote terminal
- Index(es):