shireenrao
Active member
Hello
I have a datagrid on my form. Data is retrieved into the grid using a stored procedure from oracle. My stored procedure returns a cursor. I then fill a table in a dataset with this retrieved data from the cursor, and bind it with my datagrid. here is code -
where bmbGrid1 is a BindingManagerBase. I use bmbgrid to navigate the grid using buttons. e.g. first record, next record, previous record, last record.
Now I want to insert a record into the grid. I can do that, but cant figure out a way to insert it into the database. If anybody can point me to the right direction, It will be great!! I am really desperate!!
Thank you in advance
Shireen
I have a datagrid on my form. Data is retrieved into the grid using a stored procedure from oracle. My stored procedure returns a cursor. I then fill a table in a dataset with this retrieved data from the cursor, and bind it with my datagrid. here is code -
Code:
Dim Oraclecon As New OracleConnection("SERVER=some;USER ID=some;PASSWORD=some")
Oraclecon.Open()
myCMD = New OracleCommand()
myCMD.Connection = Oraclecon
myCMD.CommandText = "package.get_Test_vals"
myCMD.CommandType = CommandType.StoredProcedure
Dim prm As OracleParameter = New OracleParameter("testValues", OracleType.Cursor)
prm.Direction = ParameterDirection.Output
myCMD.Parameters.Add(prm)
oda = New OracleDataAdapter()
oda.SelectCommand = myCMD
Dim ds As New DataSet()
oda.Fill(ds, "loadvalTable")
Dim myLoadValTable As DataTable = ds.Tables("loadvalTable")
DataGrid1.DataSource = myLoadValTable
bmbGrid1 = Me.BindingContext(myLoadValTable)
where bmbGrid1 is a BindingManagerBase. I use bmbgrid to navigate the grid using buttons. e.g. first record, next record, previous record, last record.
Now I want to insert a record into the grid. I can do that, but cant figure out a way to insert it into the database. If anybody can point me to the right direction, It will be great!! I am really desperate!!
Thank you in advance
Shireen