none
TableAdapter changes parameter size when passing parameter to query RRS feed

  • Question

  • I'm using VS2005, used dataset designer to create a table and add a new query(sql Select statement) to its table adapter. Later on i need to change the size of a column of type varchar from 3 to 10, query parameter use this column in its condition. I made changes in the table properties in database, changed the size in table's column property in dataset designer, and also in the properties of query parameters.

    I tried previewing the data for this query from designer and passed the values to input parameter. The result came fine.
    But when running the application, I have no record for same parameter. I traced through SQL profiler and came to know that the parameter is still passed as size varchar(3) instead of varchar(10).

    exec sp_executesql N'SELECT * FROM ViewClientBills
    WHERE (ClientCode = @ClientCode)'
    ,N'@ClientCode varchar(3)',@ClientCode='G-WBS'0)

    Can anyone tell me what else i have missed to change that is causing the parameter to be passed with old size.


    Developer
    Tuesday, April 21, 2009 9:03 AM

All replies

  • Trying another way to get my work done.

    I created a stored procedure in the database and add a query in TableAdapter that uses this stored procedure. Now the parameter size issue is no more there(but still i'm interested to know what i missed the first time, if anyone can tell me). But still the table adapter fill method does not populate the binding source.

    clientBillTableAdapter.FilterClientBill(fairfan.ClientBill, comboBoxClientFilter.SelectedValue.ToString);

    what do i need to check now to ensure that i'm not missing something.


    Developer
    Tuesday, April 21, 2009 11:36 AM