Protected Sub dg1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles dg1.SelectedIndexChanged im connectionString As String = "Data Source = ***; User ID = ***; Password = ***;" Dim sqlConnection As OracleClient.OracleConnection = New OracleClient.OracleConnection(connectionString) Dim queryString As String = "select * from abc where device = '"(dg1.Rows(1).Cells("I_NSPN95").ToString) '"" Dim sqlCommand As OracleClient.OracleCommand = New OracleClient.OracleCommand(queryString, sqlConnection) sqlCommand.CommandTimeout = 0 sqlCommand.Parameters.AddWithValue(":strDevice", OracleType.Char).Value = (dg1.Rows(1).Cells("I_NSPN95")) Dim dataAdapter As OracleClient.OracleDataAdapter = New OracleClient.OracleDataAdapter(sqlCommand) Dim dataSet As DataSet = New DataSet dataAdapter.Fill(dataSet) End Sub End Class
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)