hi all,
i have a query...
Dim objListItem As ListItem
objListItem = CType(cbProjectName.SelectedItem, ListItem)
Try
Dim myselectquery As String = "SELECT IsNull(1,0) FROM tbl_staff_assignments " _
& "WHERE sta_project_id_fk =(SELECT pr_project_id_pk FROM tbl_projects WHERE tbl_projects.pr_project_location = @PLoc) " _
& "AND sta_category_id_fk = cbCategoriesName.SelectedItem = 1 "
cmSQL.Parameters.Add("@PLoc", objListItem.ToString)
cnSQL = New MySqlConnection
cnSQL.ConnectionString = connect.ConnectionString
cmSQL.Connection = cnSQL
cmSQL.CommandText = myselectquery
Try
cnSQL.Open()
Dim Val As Integer
Int(Val = cmSQL.ExecuteScalar(myselectquery))
If (Val = 0) Then
MsgBox("Manager available in this project.. select other project or insert new project")
Else
insert record
is this the correct way..??
when im trying to execute this.... im getting an error:
"Object reference not set to instance of an object"
plz help..