Questions about dataset?

  • Thread starter Thread starter al
  • Start date Start date
A

al

Greetings,

-I have a table with more than one Primary Key (composite PK) in a
table in a dataset, how can search for it. ado.net seems to just
finde it if the table is composide of only thost columns and no
others??

-If table name is more than one word, how can i write Sql stat. in
Vb.net??

this code did not work with me:

"select * from orders Order_Details"
 
you can interrogate the primarykey property of the given table..
http://msdn.microsoft.com/library/d...rfsystemdatadatatableclassprimarykeytopic.asp

Where didn't the Select statement work, within the DataTable's .Select
method or as the commandtext for the command object? If you show me the
code, I can be of more help, but that should be fine for commandtext.
however, there's no reason to try to select all of the rows in a datatable
and return them as an array of datarows, after all, you have the same thing
in the datatable. Also, you can only run select statement with
DataTable.Select based on the primary Key. So this statement (AFAIK) should
never work ifyou are using DataTable.Select... but if you replace the *
with the column name and set a condition that's always true, you should get
to the same result (although as I mention, the datatable itself is the
equivalent of a Select *).

If it's on the DB side, I'm not sure what the problem is, but I'd verify
spelling, commandtype etc...post the exact exception if you would.

HTH,

Bill
 
Back
Top