-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: Shyamdotnet
Message 4 in Discussion
Hi Mirnal, We are doing with Query Builder. So that users can form their sql
statements. I have TableListBox , FieldsListBox, ValuesListBox and Logical operators
to form the Sql Statement. There is button to get the values from table. For a
particular Table and for particular field i have to fetch the values from Table name
in to List box. " Select Col1 from Table1" . this remains same for the opration of
Button click. Code : // this is in Button Click event. 'Label2.Text = "Selected"
& lstFieldnames.SelectedItem.Text
lbluniqvalues.Text += " Of " & LCase(lstFieldnames.SelectedItem.Text)
Dim uoraAdapter As OracleDataAdapter 'Oracle Adapter
Dim uoraDataset As New DataSet 'Dataset to hold table values
Dim strSql As String 'String to hold Sql Query
Dim strTablename As String strTablename =
lstFieldnames.SelectedItem.Text.Substring(0,
lstFieldnames.SelectedItem.Text.IndexOf(".", 1))
strSql = "select " & lstFieldnames.SelectedItem.Text & " from " &
strTablename & " "
uoraAdapter = New OracleDataAdapter(strSql, oraCon) 'Create Oracle Adapter
object
uoraAdapter.Fill(uoraDataset) 'Fill the dataset with records Dim
dtUser As DataTable ' Create DataTable to retrieve all tables within dataset
Dim drUser As DataRow 'Create Row object to get all rows from table
Dim dcUser As DataColumn 'Create Column Object to get all column from table
lstUniquevalues.Items.Clear() 'Clear Listitems of listbox 'Populate
Column names of selected table
For Each dtUser In uoraDataset.Tables
Dim myDate As Byte
For Each drUser In dtUser.Rows
For Each dcUser In dtUser.Columns
'If (IsDate(dcUser.DataType).TrueString) Then
' 'myDate = Convert.ToString(drUser((dcUser)))
' 'Response.Write(myDate)
' lstUniquevalues.Items.Add(Convert.ToString(drUser((dcUser))))
'Else
lstUniquevalues.Items.Add(Convert.ToString(drUser((dcUser))))
'End If
Next dcUser
Next drUser
Next dtUser
End Sub I would really appreciate if you can sugestme the code samples./links
Thanks with regards Sundar
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]