Click here to Skip to main content
15,886,873 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Structure passing problem Pin
Dave Doknjas31-May-12 11:25
Dave Doknjas31-May-12 11:25 
GeneralRe: Structure passing problem Pin
Bret Stern31-May-12 12:39
Bret Stern31-May-12 12:39 
GeneralRe: Structure passing problem Pin
Dave Doknjas31-May-12 13:01
Dave Doknjas31-May-12 13:01 
QuestionPlugin Manager Pin
Member 819828330-May-12 4:52
Member 819828330-May-12 4:52 
AnswerRe: Plugin Manager Pin
Wayne Gaylard30-May-12 5:20
professionalWayne Gaylard30-May-12 5:20 
GeneralRe: Plugin Manager Pin
Member 819828330-May-12 9:03
Member 819828330-May-12 9:03 
AnswerRe: Plugin Manager Pin
Dave Kreskowiak30-May-12 5:21
mveDave Kreskowiak30-May-12 5:21 
QuestionUnhandled exception Pin
digibat29-May-12 17:59
digibat29-May-12 17:59 
Please help on this code. I tried to update record in datetime field in access but yields concurrency exception. Tnxs.

Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click

'saves edited record.

If MessageBox.Show("Sure to save record?", "Save", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) = Windows.Forms.DialogResult.Yes Then


Dim qryTask As String = "SELECT * from tblTask where fix(task_id) = '" & id & "'"
daTask.SelectCommand = New OleDbCommand(qryTask, connection)
Dim cb As OleDbCommandBuilder = New OleDbCommandBuilder(daTask)
daTask.Fill(dsTask, "tblTask")
dtTask = dsTask.Tables("tblTask")


bolSave = True 'user saved changes.
Dim intCatId% = -1
dtTask = dsTask.Tables("tblTask")
Dim strMonth As String = Format(Me.dtpDeadline.Value, "MM")
Dim strDate As String = Format(Me.dtpDeadline.Value, "dd")
Dim strYear As String = Format(Me.dtpDeadline.Value, "yyy")
Dim strCat$ = Trim(Me.cboCategory.Text)
intCatId = udfCategoryId(strCat)


If Me.txtTask.Text = "" Or Me.txtDetails.Text = "" Then
MessageBox.Show("Please fill up Task and Task Details!", "Save", MessageBoxButtons.OK, MessageBoxIcon.Information)
Exit Sub
End If

'check date.
If Trim(strStartTime) = "" Then
If Trim(Me.txtStartTime.Text) = "" Then
strStartTime = ""
Else
strStartTime = Trim(Me.txtStartTime.Text)
End If
ElseIf Trim(strStartTime) <> "" Then
If Trim(Me.txtStartTime.Text) = "" Then
strStartTime = ""
Else
strStartTime = strStartTime
End If
End If


''check date.
If (strEndTime) = "" Then
If Trim(Me.txtEndTime.Text) = "" Then
strEndTime = ""
Else
strEndTime = Trim(Me.txtEndTime.Text)
End If
ElseIf Trim(strEndTime) <> "" Then
If Trim(Me.txtEndTime.Text) = "" Then
strEndTime = ""
End If
End If

Try
With dtTask
.Rows(0)("Task") = IIf(txtTask.Text = "", System.DBNull.Value, txtTask.Text)
.Rows(0)("Task_Details") = IIf(txtDetails.Text = "", System.DBNull.Value, txtDetails.Text)
.Rows(0)("Task_Status") = IIf(txtStatus.Text = "", System.DBNull.Value, txtStatus.Text)
.Rows(0)("Deadline") = Format(Me.dtpDeadline.Value, "MM/dd/yyy")
.Rows(0)("Year_Deadline") = Format(Me.dtpDeadline.Value, "yyy")
.Rows(0)("Task_Category_Id") = CInt(intCatId)
.Rows(0)("Start_Time") = IIf(strStartTime = "", System.DBNull.Value, FormatDateTime(strStartTime, DateFormat.LongTime))
.Rows(0)("End_Time") = IIf(strEndTime = "", System.DBNull.Value, FormatDateTime(strEndTime, DateFormat.LongTime))
End With

daTask.Update(dsTask, "tblTask")

MessageBox.Show("Record successfully saved!", "Save", MessageBoxButtons.OK, MessageBoxIcon.Information)

Catch ex As OleDbException
MsgBox(ex.ToString)
End Try
Else
MessageBox.Show("Record not saved.", "Save", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
End Sub
AnswerRe: Unhandled exception Pin
digibat29-May-12 20:07
digibat29-May-12 20:07 
AnswerRe: Unhandled exception Pin
Paul Conrad4-Jun-12 7:18
professionalPaul Conrad4-Jun-12 7:18 
QuestionSuper Trojan with source code made in vb.net Pin
mustoyildiz29-May-12 3:37
mustoyildiz29-May-12 3:37 
AnswerVoted to remove Pin
Dave Kreskowiak29-May-12 3:48
mveDave Kreskowiak29-May-12 3:48 
AnswerRe: Super Trojan with source code made in vb.net Pin
Eddy Vluggen29-May-12 4:11
professionalEddy Vluggen29-May-12 4:11 
Questionanybody has usable code sending attachment with winsock?Thanks! Pin
vb6fan28-May-12 19:04
vb6fan28-May-12 19:04 
AnswerRe: anybody has usable code sending attachment with winsock?Thanks! Pin
Dave Kreskowiak29-May-12 3:47
mveDave Kreskowiak29-May-12 3:47 
QuestionHow to compile VB.Net 2010 with mysql? Pin
Akbarblack28-May-12 9:39
Akbarblack28-May-12 9:39 
AnswerRe: How to compile VB.Net 2010 with mysql? Pin
Dave Kreskowiak28-May-12 10:22
mveDave Kreskowiak28-May-12 10:22 
GeneralRe: How to compile VB.Net 2010 with mysql? Pin
Akbarblack29-May-12 5:50
Akbarblack29-May-12 5:50 
QuestionPopulating combobox from sql server 2008 r2 in vb 2010 Pin
mayeso28-May-12 0:20
mayeso28-May-12 0:20 
QuestionButton Style (Pressed & Not Pressed) Pin
Midnight Ahri27-May-12 16:00
Midnight Ahri27-May-12 16:00 
AnswerRe: Button Style (Pressed & Not Pressed) Pin
JohnPayton27-May-12 18:02
JohnPayton27-May-12 18:02 
AnswerRe: Button Style (Pressed & Not Pressed) Pin
Alan N27-May-12 23:04
Alan N27-May-12 23:04 
AnswerRe: Button Style (Pressed & Not Pressed) Pin
Meshack Musundi4-Jun-12 21:44
professionalMeshack Musundi4-Jun-12 21:44 
QuestionCopy to Output Directory property question Pin
JohnPDB25-May-12 15:28
JohnPDB25-May-12 15:28 
AnswerRe: Copy to Output Directory property question Pin
Richard MacCutchan25-May-12 23:29
mveRichard MacCutchan25-May-12 23:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.