create datatable programmatically

Posted on 2008-11-10
Last Modified: 2012-05-05
I am tyring to create the dataentry form similar to the screen shot below. So on the page load i would have
bunch of text boxes and dropdowns, and upon submitting the form it suppose to save all that information in system.
What is the best approach to achieve that? I can create the form lookup with ASP:Table, but i am not sure
how can i save information from table to system. So creating dynamic table is the way to go, or there is some other
better approch that i can use. Thanks a lot in advance for your help.
Question by:GWebHMP
    1 Comment
    LVL 4

    Accepted Solution

    I am not sure about the best approach but this is how you can create a data table,

    DataRow objDR;
    DataTable objDT = new DataTable("RVI");
    objDT.Columns.Add(new DataColumn("ProductID", typeof(Int32)));
    objDT.Columns.Add(new DataColumn("Name", typeof(String)));

    //Each time you create a new row
     objDR = objDT.NewRow();
     objDR["ProductID"] = Textbox1.Text;
    objDR["Name"] = Textbox2.Text;
    objDR["Designer"] = ddcountry.SelectedValue;

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Ajax and MVC 2 55
    jquery, aspx 10 34
    String.IsNullOrEmpty in vb,net question 1 32
    Javascript - getdate 5 32
    AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
    Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now