jimmy shown

jimmy shown

  • NA
  • 6
  • 5.8k

add null value in oracle database

Mar 5 2011 9:10 AM
I am trying to add null value in my oracle database but its not Inserting any record, not even inserting null value and not throwing any error also...

Please, help...

Dim
sqlStmt As String

Dim conString As String







Dim cn As OracleConnectionDim cmd As OracleCommandDim sqldatenull As OracleDateTrysqlStmt =


"insert into temp (startdate, enddate) Values (@startdate, @enddate)"'conString = "server=localhost;database=Northwind;uid=sa;pwd=;"conString =
cn = New OracleConnection(conString)
cmd = New OracleCommand(sqlStmt, cn)


"Data Source=abc; User Id=abc;Password=ab"cmd.Parameters.Add(
cmd.Parameters.Add(New OracleParameter ("@enddate", OracleDbType.TimeStamp))sqldatenull = oracledate.null

If
New OracleParameter ("@startdate", OracleDbType.TimeStamp))
cmd.Parameters(
'cmd.Parameters("@Date").Value = DBNull.ValueElse
"@EndDate").Value = DateTime.Parse(txtEndDate.Text)


"@EndDate").Value = sqldatenull

Answers (5)