sara 0 Newbie Poster

Try running your program again :) I'm sure you'll get the same error.

Here i 'give my sample coding to help me.

Protected Sub btnaccept_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnaccept.Click
Dim strSQl As String
Dim strluaran, strPersekitaran, strperibadi As String
Dim mycommand As OleDbCommand = New OleDbCommand


conn = New OleDbConnection(connString)
mycommand.Connection = conn

lbldate.Text = Format(Date.Now, "dd-MMM-yyyy")

If IsDBNull(chkluaran.SelectedItem.Text) Then
chkluaran.SelectedItem.Text = ""
End If
If IsDBNull(chkPersekitaran.SelectedItem.Text) Then
chkPersekitaran.SelectedItem.Text = ""
End If
If IsDBNull(chkperibadi.SelectedItem.Text) Then
chkperibadi.SelectedItem.Text = ""
End If
strSQl = " INSERT INTO scan_Cust_result(cust_name,cust_mothername, cust_result_email, cust_result, result_luaran, result_persekitaran, " _
& " result_peribadi, cust_desc, date_created) VALUES " _
& " ('" & lblname.Text & "', '" & lblmothername.Text & "','" & lblemail.Text & "', '" & chkmasalah.SelectedItem.Text & "', " _
& " '" & chkluaran.SelectedItem.Text & "', '" & chkPersekitaran.SelectedItem.Text & "', '" & chkperibadi.SelectedItem.Text & "', " _
& " '" & txtdesc.Text & "', '" & lbldate.Text & "')"
Try
conn.Open()
mycommand.ExecuteNonQuery()
conn.Close()
Response.Write("Your Results are Successfully Saved.")
Catch SQLexc As OleDbException
Response.Write("Insert Failed. Error Details are: " & SQLexc.ToString())
End Try

End Sub

sara 0 Newbie Poster

Hi,

I've problem here. I create 3 check boxlist using vb.net 2.0. One of my check boxlist is uncheck when i try to save in database. when i want to save this using Microsoft access database the error come System.NullReferenceException – “Object reference not set to an instance of an object.

Please help me to encounter this problem.

sara 0 Newbie Poster

i think tat u hav to use loop to insert multiple rows into database.

Can u give me sample coding the loop..

sara 0 Newbie Poster

Hi everyone..
I have problem here..
i want to calculate total days using vb.net..this calculation not including public holiday. i have calendarstartdate, calendarenddate and txttotalabsent. my problem here how to capture public holiday and how to calculate total days.
please help me :sad: ..

sara 0 Newbie Poster

i use checkboxlist. checkboxlist have selectedItem

sara 0 Newbie Poster

Hi..
Tq reply my message..
This system only capture public holiday..Friday and saturday for every week is public holiday.
working day start on Sunday till Thursday. 21st Apr is public holiday.

sara 0 Newbie Poster

Hi..
I've problem here.
I have checkbox chkdrugnegative..user can select more than one drug name.
my problem is how to insert to database. how the table. i'm using pl/sql.
here is my sample coding.

Private Function adddrugtest() As Integer

Dim oleConn As OleDb.OleDbConnection
Dim roleData As OleDb.OleDbDataAdapter
Dim oleCmd As OleDb.OleDbCommand
Dim recSet As New DataSet()
Dim connString As New ConnectionString()
Dim strCon As String
Dim strSQL As String
Dim strSQL2 As String
Dim int_row_insert As Integer
Dim nexttestIdSeq As Integer
Dim clsUtility As New Utility()

strCon = connString.connPMO

oleCmd = New OleDb.OleDbCommand("", New OleDbConnection(strCon))
oleCmd.CommandType = CommandType.Text
oleCmd.Connection.Open()

nexttestIdSeq = Me.getMaxtestID + 1

'strSQL = " INSERT INTO PMO_ALCOHOL_TEST " _
' & " ( TEST_ID, DATE_TEST, SITE_TESTING, RESULT, SUPERVISOR, REMARK, DATE_CREATED ) " _
' & " VALUES " _
' & " (" & nexttestIdSeq & ", '" & txtdate.Text & "', " & cbosite.SelectedItem.Value & ", " _
' & " '" & rdbresult.SelectedItem.Text & "', '" & txtsupervisor.Text & "', '" & txtremark.Text & "', sysdate )"

strSQL = " INSERT INTO PMO_DRUG_TEST_MASTER " _
& " ( TEST_ID, DATE_TEST, SITE_TEST, RESULT, TYPE_DRUG, " _
& " TYPE_DRUG_TEST_POST, CONFIRM_DATE_TEST, CONFIRM_RESULT, " _
& " CONFIRM_TYPE_DRUG_POST, SUPERVISOR, REMARK, staff_name, staff_no, " _
& " Department, section, position, " _
& " USER_ASSIGN_NO, USER_ASSIGN_NAME, DATE_CREATED) …

sara 0 Newbie Poster

Hi..
anyone outthere have sample coding leave application. This application will calculate how many days u take leave not including public holidays.
Please help me?

sara 0 Newbie Poster

hi..
can u help me calculate age using vb.net.
i have txtage.text and txtdob.text.
the format dob is 21.03.1978.

and if txtage.text <35 it will in group 1, if txtage.text < 49 it will in group 2. the group in radiobutton. i've bee thinking this problem almost 3 days. please anyone out there help me.

sara 0 Newbie Poster

hi..
can u help me calculate age using vb.net.
i have txtage.text and txtdob.text.
the format dob is 21.03.1978.

and if txtage.text <35 it will in group 1, if txtage.text < 49 it will in group 2. the group in radiobutton. i've bee thinking this problem almost 3 days. please anyone out there help me.