B
Butt Chin Chuan
Hello everyone!
I got a serious problem here which I tried for a week
debugging it but cannot solve it. The problem is this: I
tried to post a reply in my application to a previous
post, and the code is the following:
sqlconn.Open()
sql = "SELECT count(Message_ID) as CurrentMaxID from
tblReplyMessage"
Dim objAdapter1 As New SqlCeDataAdapter(sql, sqlconn)
objAdapter1.Fill(objDataset, "MID")
objDataTable1 = objDataset.Tables("MID")
Dim InsertID As Integer = CInt(objDataTable1.Rows(0).Item
("CurrentMaxID")) + 1
sqlconn.Close()
MsgBox("InsertID = ", InsertID)
Now, in my message box, I cant get anything out of it, I
get the message ("InsertID = "), meaning there isnt any
return value in my select. However, I tried in SQL2000 and
SQLCE Query Analyzer, and I got my results. The adapter
and the datatable, although i used it in other forms, is
localized (Private). What is the possible cause here? I
really need my work getting done, and I (hopefully not my
careless mistake somewhere) am getting stuck here like
forever. Please comment, your help is very much
appreciated!
I got a serious problem here which I tried for a week
debugging it but cannot solve it. The problem is this: I
tried to post a reply in my application to a previous
post, and the code is the following:
sqlconn.Open()
sql = "SELECT count(Message_ID) as CurrentMaxID from
tblReplyMessage"
Dim objAdapter1 As New SqlCeDataAdapter(sql, sqlconn)
objAdapter1.Fill(objDataset, "MID")
objDataTable1 = objDataset.Tables("MID")
Dim InsertID As Integer = CInt(objDataTable1.Rows(0).Item
("CurrentMaxID")) + 1
sqlconn.Close()
MsgBox("InsertID = ", InsertID)
Now, in my message box, I cant get anything out of it, I
get the message ("InsertID = "), meaning there isnt any
return value in my select. However, I tried in SQL2000 and
SQLCE Query Analyzer, and I got my results. The adapter
and the datatable, although i used it in other forms, is
localized (Private). What is the possible cause here? I
really need my work getting done, and I (hopefully not my
careless mistake somewhere) am getting stuck here like
forever. Please comment, your help is very much
appreciated!