tableAdapter Headaches. I need help

Last post 10-17-2006 12:08 AM by Gordon-Freeman. 2 replies.

Sort Posts:

  • tableAdapter Headaches. I need help

    10-12-2006, 10:08 PM
    • Loading...
    • derry1406
    • Joined on 10-12-2006, 7:06 PM
    • Posts 2

    I have developed headaches since I have been trying to do this for a whole week.  What is the proplem?

    I just got introduced to dotnet and have been writing a web application as part of my final year thesis project.

    I have gotten to a point where I want to insert textbox, dropdownlistbox and other control values into a table at the click of a button.

    I have  table adapter that has an insert method; however i dont know how to use this method to get the values of my textboxes, dropdownlist box into the database table.

    this is a sample code I have written:

    public void insertIntoBuyOrder() {

    OrderTableAdapter buyOrderInsert = new OrderTableAdapter();

    buyOrderInsert.("@symbol, @userName, @orderType, @orderQuantity, @price, @timeInForce, @side, @priority, @orderDate");

     

     

    String insertCommand = " INSERT INTO [Order] ([symbol], [userName], [orderType], [orderQuantity], [price], [timeInForce], [side], [priority], [orderDate]) VALUES (@symbol, @userName, @orderType, @orderQuantity, @price, @timeInForce, @side, @priority, @orderDate)";

     

     

    }

    I dont know how to use the insert method of my table adapter to get the values of my textbox, dropdownlistbox, into the order table.

     

    Any help will be much appreciated 

     

     

  • Re: tableAdapter Headaches. I need help

    10-13-2006, 7:54 AM
    • Loading...
    • derry1406
    • Joined on 10-12-2006, 7:06 PM
    • Posts 2

    It seems nobody wants to help.  I am completely stuck and I need help.  All I want is to be able to use my tableadapter and its insert method to insert data into my database ORDER table. 

    my problem is using the tableadapter and my insert method to get the values of my textbox fields and dropdownlistbox fields into my database ORDER table.

     

    Please help.

     

  • Re: tableAdapter Headaches. I need help

    10-17-2006, 12:08 AM

    buyOrder.Insert("@symbol, @userName, @orderType, @orderQuantity, @price, @timeInForce, @side, @priority, @orderDate"); Don't know what this means.

    You need some basic programming and database knowledge... the params that Insert takes should be from your TextBoxes or DropDowns, such like buyOrder.Insert(tbSymbol.Text, tbUserName.Text, ddlType.SelectedValue, xxx, ...etc.);

    你好! Just FYI o_O
Page 1 of 1 (3 items)
Microsoft Communities
Page view counter