Hello guys,
I'm now wirting a program that is expected to excute a conditional SQL query.
following is part of my code:
Code:Sub method() Dim dt As DataTable = GetData(" select lotid from actl where eqpid='S103SIG' and lotid not in (select lotid from rpt_del_lot) ") IfNotdt.Rows(r).Item("lotid")IsNothingThen GetData("SQL goes on here") else GetData("SQL goes on here") EndIfI'm wondering if this code can run as expected. In other words, whether the previous data in datatable can be updated by the data got from the next "GetData" statement. And whether this condition goes the same in datagridview.Code:PublicFunction GetData(ByVal selectCommand AsString) As DataTable Try Dim connectionString AsString = _ " Data Source=singdb;User ID=mfg_rpt;Password=sentosa;Unicode=True;" ' Create a new data adapter based on the specified query. Me.dataAdapter = New OracleDataAdapter(selectCommand, connectionString) Dim commandBuilder AsNew OracleCommandBuilder(Me.dataAdapter) ' Populate a new data table and bind it to the BindingSource. Dim dt AsNew DataTable() dt.Locale = System.Globalization.CultureInfo.InvariantCulture Me.dataAdapter.Fill(dt) Return dt Catch ex As OracleException MessageBox.Show("To run this example, replace the value of the " + _ "connectionString variable with a connection string that is " + _ "valid for your system.") EndTry EndFunction
Thank you very much!!![]()


LinkBack URL
About LinkBacks




Reply With Quote


Bookmarks