Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

Posted

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.

Posted

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()

Posted

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.

Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...