Binding textboxes to dynamically created TableAdapter (VB.NET)

Hi All

I started a form with the premise thath the following should be quite a straight forward thing to do, but it seems that there is no simple answer for this anywhere. I hope the experts in here can help me out.

I have a form with various textboxes, showing sales lead details. Things like firstname, lastname, companyname etc.

I then create the following in the Page_Load event


dsLeadFill As New DCAdminTableAdapters.CapturedLeadsTableAdapter



The tableadapter should now be filled with the lead details I want. Now how do I use those values stored inside it. I just want the textboxes on the form to display the records details, nothing else.

Is there a simple thing to use like:

txtFirstName.text = dsLeadFill.Firstname

I'm probably doing this all wrong. Once the textboxes have been completed, the form submits when someone clicks the Button control, and it calls the following which works perfectly:

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)

Dim dsLeadUpdate As New DCAdminTableAdapters.CapturedLeadsTableAdapter

Dim strUser As MembershipUser = Membership.GetUser()

dsLeadUpdate.UpdateLeadDetails(txtCompanyName.Text, ContactFName.Text, ContactLName.Text, ContactPosition.Text, ContactPhone.Text, txtEmail.Text, StreetNumber.Text, StreetName.Text, City.Text, County.Text, postcode.Text, Country.Text, KeyBusiness.Text, cboInterest.SelectedValue, TimeScale.Text, KeyReasons.Text, NextAction.Text)



End Sub


I Don't want to use gridview, formview, datalist or any other control, I need to use textboxes because of various comboboxes etc which allow user intercation.

Are there any straight answers to this one?? Any help will be appreciated.

Thanks, D

6/5/2006 9:31:12 AM 16182 articles. 0 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 10

The GetDataByLeadID method returns a typed DataTable. The TableAdapter doesn't store the results inside it, as you seem to think. So you need to do something like this:

Dim dsLeadFill As New DCAdminTableAdapters.CapturedLeadsTableAdapter

Dim dtCapturedLeads As DCAdmin.CapturedLeadsDataTable

dtCapturedLeads = dsLeadFill.GetDataByLeadID(Request.QueryString("LeadID"))

txtFirstName.Text = dtCapturedLeads[0].Firstname

Hope that helps.

6/5/2006 4:25:13 PM

Similar Artilces:

.Net 2.0 Web application using is unable to create object of another dll writen in C# .net 2.0
Hi, I habe created one web application using which is adding reference of dlls written in C# and .net 2.0. But whenever trying to create object of referencing dll, it is throwing error :Object reference does not set to an object. But, locally it is working fine,. In the server i have deployed the .aspx files and dll files in the bin. There were already an web.config in the server which is of .net 1.1. But checked it is retrieving value for that web.config correctly. Should i have to deply any other files and if not what can be the solution for this? Please help. Thanks, So...

Dynamically Creating Flash Object .net vb
I created a handful of flash files for tutorials.  I was wondering if you could edit the code behind or dynamically create the flash object on the page load.  I want to be able to pass in the swf name from one page to another so i only have to create one popup window for the flash tutorials.   Thanks While I'm sure you could get into the embeded objects properties, and manually edit the settings of it to match your needs, this might not be the most desirable.  My advice would be to use a .net flash control that has server side managed code.  Here's a grea...

Please help me create objects dynamically at runtime with VB.NET!!!
Hi I have been trying to figure out the best (and most simple) way to dynamically create user-defined objects at runtime, but this can be a little frustrating being new to VB.NET. Anyway, the object(s) I am trying to instantiate are ones that I've written myself and have placed in a class library (which resides in the "bin" directory of my application root directory). Here's a snippet of the last thing I tried, but for some reason Type.GetType seems to return a null pointer reference (any suggestions?): NOTE 1: I have not registered this assembly/DLL, and don't plan on ...

Sending SMS using or using or
Hi  My requirement is I hav one csv file with these fields id,mobilenum,messgae,status.intiallu staus is 0. once i read the all fileds and take that mobile number.using tat mobile number  i need to send sms .after sending sms i shuld change status as 1 How to send sms thru coding (please dont provide any links.if it is provide also please give working links becox i checked codeproject .i didnt get any nice link. and also provide the how to update the status field im csv file   Thank ssandhya   To send SMS, you need some third party SMS providers. if you consul...

Using the Textbox.Text on Dynmaicly Created Textboxes in VB.Net
I found a script that i modified to create textbox fields Dynamicly.  I am now faced with the delimia of figuring out a way to pull the data in those dynamicly created fields.  Since they are not defined, I have not found a way to use a variable to pull the data. Here is the code .aspx   <%@ Page Language="VB" AutoEventWireup="false" CodeFile="DynamicTextboxes.aspx.vb" Inherits="DynamicTextboxes" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "

Sorting a Dynamic Table created by VB.Net (Needs Javascript and/or VB Code)
Hello everyone (forgive me for a double post, but the admin put it in Master Page/Themes for some reason, and I am in need of assistance fairly urgently),  I am working on trying to set up a sort image on the headers of each of my columns. I have in VB.Net code dynamically create a table fully variablized. My issue is that I am adding a script for something like this into the headers. It creates the image next to the header and displays it on the table. ======== HeaderItem.Src = "\Images\SortOff.png" HeaderItem.Width = 15 HeaderItem.Height = 15 HeaderItem.Attributes(&qu...

converting to from offered me some sample code when I signed up with them the only problem is the sample code is in but my page that they type all of their credit card into is <code><%@ Import Namespace="System.Net" %> <%@ Import Namespace="System.IO" %> <script language="C#" runat="server"> void Page_Load(Object Src, EventArgs E) { myPage.Text = readHtmlPage(""); } private String readHtmlPage(string url) { ...

latebinding and early binding in or
 Hi i have littlie confusion if any one clear diffrences  between latebinding and earlybinding adilahmed  Hi there,              take a look at this thread               I hope it helps. Regards,Fernando.  ...

Creating parameters dynamically from
Hi, Can you please help me out in creating parameters dynamically from and how to pass values to those. Its urgent....

Create array Textbox (
How I create Array Component ( Like this : Textbox1(0).text="First" Textbox1(1).text="Second" can it create by design. Thanx Regards check out below example > VB.NET: What Happened to Control Arrays!!! (Part I) WinForms Controls—Creating Control Arrays in VB.NEThope it helps./. Thanx, [KaushaL] || BloG || Profile || Microsoft MVP"I would love to change the world, but they won’t give me the source code"Don't forget to click "Mark as Answer" on the post that helped you.This credits that member, earns you a point and mark your thr...

How do I bind a textbox to a database VB.Net
I am an old time VB6.0 programmer who is making the transition into VB.Net. I'm having problems connecting a textbox to a database field. I can get dropdown lists to work and datagrids, but I need textboxes to display data. The first step in this code sample from shows how to query a database and put the returned data into textboxes: WierMCP/ - where to look first!Please Vote for ASPNet101 - 'Best Community Resource'!Control Grouper - easily control properties for multiple c... vs vs
just out of curiousity which looks, acts most like java? i'm still learning trying to used to but it seems that it was easier to do some stuff with java. C# is Java++ in my opinion. If you have done C or Jave you will prefer C#.Mike Schellenberger - MCAD If you are looking for language similar to java go for J#. However most code samples you find on the net will be in VB.NET and C#....

How to create array of strings dynamically in
Hi there I need to read the menu items from table and wants to create arrays of menus dynamically. Like dim Expertise() as string = {"ONE", "TWO", "THREE"} ONE, TWO and THREE will be comming from the database. Pls assist me the same for my convenient. Regards Raj_________________________________________________________________________...

Create Dynamic templatefields in a gridview with
 Hi, I 'm looking for a solution to create dynamic  templatefields for a gridview with code.Can anyone help me with this ?  Philip Consider one of these based on your needs:  Drop a loginview into a template column. Drop a panel that contains controls into a template column and set the panels visiblity. Drop a control into a template column and set its visiblity.  Good Luck  Do you have an example as such for this? Kind regards, Phil You bet I do. http://www.gosylv...

Web resources about - Binding textboxes to dynamically created TableAdapter (VB.NET) -

Handling ReportViewer Parameters
Consider that in a Reporting Services report processor-generated report, all of the parameters (both query and report) are handled behind the ...

The Parable of The Road Line Painter
-*+Way back in the day when lines were first being painted on roads. The early lines were painted by hand. In those days, a painter was hired ...

Selecting a CMS: developing usage scenarios
EBSCOhost serves thousands of libraries with premium essays, articles and other content including Selecting a CMS: developing usage scenarios. ...

Sample code for a very very simple VB database application
I wrote a short piece for Personal Computer World about making a simple Windows Forms database application. I did this because I get a lot of ...

DotNetNuke Modules – Data Access Layer
-*+On Tuesday, we started working on the code for our Data Access Layer by having CodeSmith generate some classes for us. Today, we are going ...

Resources last updated: 1/18/2016 2:41:53 PM