vb.net - Populating a DataGrid using a Parameterised SQL Server Stored Procedure -


i'm newb visual studio , vb , need little help.

i've created project in visual studio 2012 express with:

  1. a data connection sql server db
  2. within data set
  3. a data source/tableadaptor linked
  4. a stored procedure.

it seems difficult see data connections, data sets, data sources , table adaptors have been created , i'm confused why 1 , 2 aren't same thing.

the stored procedure accepts parameters , provides results based on parameters.

in preview - works fine.

now, i'm trying populate data grid data data source using supplied parameters when button pressed. i'm falling down. i've instantiated tableadaptor

private sub btnreport_click_1(sender object, e routedeventargs) handles btnreport.click     dim tableadapter new jbdataset.p_utility_unlocked_tasksdatatable()      me.mydatagrid.datasource = tableadapter.getdata("report", "1234")  end sub 

i think first line (dim) correctly instantiates tableadapter know second line incorrect. i've looked on , cannot find out need do.

what's compile-time type of tableadapter? hover on in vs , check.

my guess it's datatable:

dim tableadapter new jbdataset.p_utility_unlocked_tasksdatatable() 

because object referencing called tasks datatable.

you use dataadapter like this:

dim querystring string = _   "select customerid, companyname dbo.customers" dim adapter sqldataadapter = new sqldataadapter(querystring, connection)  dim customers dataset = new dataset adapter.fill(customers, "customers") 

Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -