Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Re: Populating a text box with a Data Adapter

Reply
Thread Tools

Re: Populating a text box with a Data Adapter

 
 
Scott M.
Guest
Posts: n/a
 
      03-11-2010
Well, I would start by making the textbox markup correctly.

You've got:

<asp:TextBox ID="ClaimInfo" runat="server" </asp:TextBox>

<asp:TextBox ID="PIC" runat="server" </asp:TextBox>

And you should have:

<asp:TextBox ID="ClaimInfo" runat="server"></asp:TextBox>

<asp:TextBox ID="PIC" runat="server"></asp:TextBox>

And then I'd add some code that gets the data from your DataSet and puts it
into your Textboxes. All you've got is code that goes to the database and
populates a DataSet - - it doesn't attempt to use that data.

-Scott

"JJ297" <> wrote in message
news:45623c9c-4d01-4244-8c35-...
> I'm unable to get any data to come up/appear in my text boxes...what
> am I doing wrong?
>
> I have two textboxes on Default.aspx
>
> <asp:TextBox ID="ClaimInfo" runat="server" </asp:TextBox>
>
> <asp:TextBox ID="PIC" runat="server" </asp:TextBox>
>
>
> I'm bringing the values over in a querystring and wrote a stored
> procedure to select * from the table.
>
> ALTER procedure [dbo].[GetClaiminfo]
>
> @Claiminfo char(6),
> @PIC char(2)
>
> As
>
>
> SELECT *
> FROM DelayedClaim
> WHERE claiminfo = @claiminfo and pic = @pic
>
> When the page loads I want these two text boxes to populate from info
> from the database:
>
> <asp:TextBox ID="LAF" runat="server" </asp:TextBox>
>
> <asp:TextBox ID="Docpmtt" runat="server" </asp:TextBox>
>
>
> Here's the page load info but nothing appears in the textboxes:
>
> Dim conn As New
> Data.SqlClient.SqlConnection(ConfigurationManager. ConnectionStrings("ConnectionString").ConnectionSt ring)
> Dim cmd As New Data.SqlClient.SqlCommand
> With cmd
> .CommandType = Data.CommandType.StoredProcedure
> .CommandText = "GetClaimInfo"
> cmd.Parameters.AddWithValue("@claiminfo",
> Integer.Parse(Request.QueryString("claiminfo")))
> cmd.Parameters.AddWithValue("@pic",
> (Request.QueryString("pic")))
> .Connection = conn
> End With
> Dim adapter As New Data.SqlClient.SqlDataAdapter(cmd)
>
> Try
> conn.Open()
> Dim ds As New Data.DataSet
> adapter.Fill(ds)
>
>
> Finally
> conn.Close()
> End Try
>
> What am I missing? Thanks!



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
div box questions; float text around a box, fit box to image size Gnarlodious HTML 4 05-05-2010 11:30 AM
CalendarExtender.SelectedDate without populating text box mohaaron@gmail.com ASP .Net 4 10-07-2009 03:03 PM
issue when populating data in textbox on dropdownlist box selection Dhananjay ASP .Net 1 12-23-2007 03:55 AM
Populating a text box with a value from a function Kermit Piper Javascript 1 03-16-2006 05:11 AM
Populating a drop-down box from the names of text files in a folder Matt Davidson Javascript 3 07-23-2004 01:37 PM



Advertisments