yaniv Posted June 17, 2003 Posted June 17, 2003 Well, I just want to get the "lastname" column from dataset table, where id = 1, But i can't find the way to do it. The dataset.select returns only datarows object which is too complicated for the simple task. can it be done? my dataset called "product" and the table is "product" too. Quote
Moderators Robby Posted June 18, 2003 Moderators Posted June 18, 2003 USe an SQL statement to retrieve the data.... "Select Lastname From Product Where id = 1" Quote Visit...Bassic Software
yaniv Posted June 18, 2003 Author Posted June 18, 2003 hello roby, the sql is good to get thedata from the database, but i want to get from the dataset, where should i put the sql statment? you don't have "commandtext" in dataset's. Quote
spebola Posted June 18, 2003 Posted June 18, 2003 Do some research on the following code. You will need to add your connection to the database oConn. When your connection is set you will need to change Oracle to OLEDB, sql, etc. on the first 3 lines and import the appropriate namespace. Dim da As OracleDataAdapter Dim ds As New DataSet Dim cmd As New OracleCommand cmd.CommandType = CommandType.Text cmd.CommandText = "SELECT lasstname from Product _ WHERE ID = 1" cmd.Connection = oConn da = New OracleDataAdapter(cmd) Try da.Fill(ds) Catch ex As Exception MessageBox.Show(ex.Message.ToString) End Try oConn.Close() Quote
WhiZa Posted June 19, 2003 Posted June 19, 2003 I am looking to do the same thing. I would like to pull in my data into the dataset from an XML file. Then do a SELECT on the dataset. This may not be the logic way to do this, but I am wondering if it is possible. Quote
yaniv Posted June 19, 2003 Author Posted June 19, 2003 if you want to do the select on all table, and not just to get one field, use dataview. type dataview in th serch and walk with the walkthrow Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.