Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Difference between SQL and Oracle in ASP.net 1

Status
Not open for further replies.
Joined
Mar 14, 2002
Messages
711
Location
US
I have mostly been working with Oracle 9i in ASP.Net and this is my first project working with a SQL database in .net, and so far everything has gone very well, in fact, much easier than Oracle, except for my datagrid...

In Oracle, I am using similar code and it works fine, but in SQL, I keep getting the error message "incorrect syntax near Line 1 ')' " on this line:

DataGrid1.DataSource = cmdSelect.ExecuteReader

Here is the whole code for the datagrid:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Const StrConnString As String = "server=sdrvname;uid=uid;pwd=pwd;database=db"

Dim objConn As New SqlConnection(StrConnString)

objConn.Open()

Dim cmdSelect As SqlCommand

cmdSelect = New SqlCommand("Select * From Kaizen WHERE Title IS NOT NULL)", objConn)


Dim DataReader As SqlDataReader

DataGrid1.DataSource = cmdSelect.ExecuteReader
DataGrid1.DataBind()

objConn.Close()

End Sub

What am I doing wrong in SQL???

Thanks for any help,
 
You need to remove the ")" after "NULL".
 
Thanks andrea96, it is amazing how blind one can be certain days, or lately is seems like every day, hehehehe.

That did the trick!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top