G
Guest
I've written the following and found that the ISNULL function is not working properly. I want to be able to query the Firstname record from an access database and have it return a string of my preference when the Firstname field is null. I found that this is isn't happening. Under transact-sql ISNULL is to have a replacement parameter and find that I receive a wrong parameters error message with my code. I've tried using the nz command for msAccess and I receive a function not found error. Is there a way to return a string for a null value from vb.net querying an access database?. My code is below
Dim x as strin
Dim conn As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=Test.MDB"
x = "SELECT Name, ISNULL(FirstName,'John') From MyTable
Dim cmd As New OleDb.OleDbCommand(x, conn
Dim rdr As OleDb.OleDbDataReade
Tr
conn.Open(
rdr = cmd.ExecuteReade
repeaterOrderDetails.DataSource = rd
repeaterOrderDetails.DataBind(
rdr.Close(
conn.Close(
Catch ex As Exceptio
Response.Write(ex.Message
Response.End(
Finall
If conn.State = ConnectionState.Open The
conn.Close(
End I
End Tr
Dim x as strin
Dim conn As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=Test.MDB"
x = "SELECT Name, ISNULL(FirstName,'John') From MyTable
Dim cmd As New OleDb.OleDbCommand(x, conn
Dim rdr As OleDb.OleDbDataReade
Tr
conn.Open(
rdr = cmd.ExecuteReade
repeaterOrderDetails.DataSource = rd
repeaterOrderDetails.DataBind(
rdr.Close(
conn.Close(
Catch ex As Exceptio
Response.Write(ex.Message
Response.End(
Finall
If conn.State = ConnectionState.Open The
conn.Close(
End I
End Tr