Click here to Skip to main content
15,888,984 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionImplementing "Form_Current" in VB.NET Pin
Cliph29-Mar-13 6:39
Cliph29-Mar-13 6:39 
QuestionVb6 ADODC Login failed for the user knows in Windows 7 Pin
marco.bruni27-Mar-13 23:39
marco.bruni27-Mar-13 23:39 
AnswerRe: Vb6 ADODC Login failed for the user knows in Windows 7 Pin
Richard MacCutchan28-Mar-13 0:05
mveRichard MacCutchan28-Mar-13 0:05 
GeneralRe: Vb6 ADODC Login failed for the user knows in Windows 7 Pin
marco.bruni28-Mar-13 3:45
marco.bruni28-Mar-13 3:45 
GeneralRe: Vb6 ADODC Login failed for the user knows in Windows 7 Pin
Richard MacCutchan28-Mar-13 3:56
mveRichard MacCutchan28-Mar-13 3:56 
AnswerRe: Vb6 ADODC Login failed for the user knows in Windows 7 Pin
Eddy Vluggen28-Mar-13 7:22
professionalEddy Vluggen28-Mar-13 7:22 
AnswerRe: Vb6 ADODC Login failed for the user knows in Windows 7 Pin
Kenneth Haugland31-Mar-13 18:37
mvaKenneth Haugland31-Mar-13 18:37 
QuestionConcurrency violation or Insert Pin
IgaBaro26-Mar-13 5:17
IgaBaro26-Mar-13 5:17 
I am getting this error when ever I want to add a second student to a form that has a Student ID that is Auto incremented. I first tried inserting all field to the database using the following code but failed to insert the Student photo and the enroll date properly.
Private Sub SaveBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveBtn.Click
        Dim m, fe, F, P, H As String
        Dim STPhoto As Image
        Dim EnrollDate As Date
  EnrollmentDateTxt.Value = Format(Now.Date, "yyyy-MM-dd")
  EnrollDate = EnrollmentDateTxt.Value
        

 Dim TA As StudentEnrollmentDataSetTableAdapters.StudentEnrollmentTblTableAdapter

TA.Insert(StudentIDTxt.Text, TelephoneTxt.Text, FirstNameTxt.Text, MiddleNameTxt.Text, LastNameTxt.Text, LevelTxt.Text, ClassroomTxt.Text, GuardianFnTxt.Text, GuardianLnTxt.Text, InstructorLnTxt.Text, m, fe, F, P, H, StudentPhoto.Image, DoBTxt.MaxDate, EnrollDate.Date, GraduationDateTxt.MaxDate, AboutStudentTxt.Text)


So I decided to use the dataset drag & drop feature to see if it can be helpful. It worked for the first entry but if I want to add another student right after the first one I am Getting the Concurrency Violation and the
Me.TableAdapterManager.UpdateAll(Me.StudentsListDataSet)
is highlighted.
here is the full save button code:
VB
Private Sub SaveBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveBtn.Click
        'Validations for all text boxes
        If FirstNameTextBox.Text.Trim = "" Then
            MsgBox("Fadlan Gali magaca hore ee Ardayga", MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly, "First Name box cannot be empty")
            FirstNameTextBox.Text = Focus()
            Exit Sub
        End If
        If FirstNameTextBox.Text.Contains(".") Or FirstNameTextBox.Text.Contains("-") Then
            MsgBox("Adeer Dhibic iyo xariixin lama ogala ee magaca hore ee ardayga gali", MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly, "First Name box cannot contain (.) or (-)")
            Exit Sub
        End If
        Try
            'Add student to database
            Me.Validate()
            Me.FulltimeStudentsTableBindingSource.EndEdit()
            Me.TableAdapterManager.UpdateAll(Me.StudentsListDataSet)
            MsgBox("Waxaad ku dartay 1 arday ", MsgBoxStyle.OkOnly, "One Student Added to Students lists")
            Me.StudentsListDataSet.Dispose()
            Me.TableAdapterManager.Dispose()
            Me.Refresh()


I am not sure what
I am doing wrong as I when trough the code line by line and couldn't figure it out. I will highly appreciate if anyone can point me to what I am doing wrong. I even added an Insert Query into the table adapter to handle the table insert. Please help me if you can with any of my methods.
Thank you in advance. Sleepy | :zzz:
AnswerRe: Concurrency violation or Insert Pin
Eddy Vluggen27-Mar-13 9:39
professionalEddy Vluggen27-Mar-13 9:39 
GeneralRe: Concurrency violation or Insert Pin
IgaBaro28-Mar-13 3:11
IgaBaro28-Mar-13 3:11 
AnswerRe: Concurrency violation or Insert Pin
Eddy Vluggen28-Mar-13 7:15
professionalEddy Vluggen28-Mar-13 7:15 
QuestionHow make steganography in video (.AVI) Pin
Khairul Imam25-Mar-13 11:42
Khairul Imam25-Mar-13 11:42 
AnswerRe: How make steganography in video (.AVI) Pin
GuyThiebaut25-Mar-13 22:45
professionalGuyThiebaut25-Mar-13 22:45 
QuestionI want to do all the functionalty of painting on an image?? Pin
Lolo Hyun25-Mar-13 6:55
Lolo Hyun25-Mar-13 6:55 
AnswerRe: I want to do all the functionalty of painting on an image?? Pin
Richard MacCutchan25-Mar-13 7:39
mveRichard MacCutchan25-Mar-13 7:39 
AnswerRe: I want to do all the functionalty of painting on an image?? Pin
Eddy Vluggen25-Mar-13 8:06
professionalEddy Vluggen25-Mar-13 8:06 
Generalkeyboard controlling arduino rc car with UDP packets (VB 2008) Pin
Jose Sallamanca20-Mar-13 8:59
Jose Sallamanca20-Mar-13 8:59 
AnswerRe: keyboard controlling arduino rc car with UDP packets (VB 2008) Pin
MicroVirus27-Mar-13 4:11
MicroVirus27-Mar-13 4:11 
Questionremove or disconnect disk/sotrage Pin
V1rus9r20-Mar-13 3:51
V1rus9r20-Mar-13 3:51 
AnswerRe: remove or disconnect disk/sotrage Pin
Richard MacCutchan20-Mar-13 4:04
mveRichard MacCutchan20-Mar-13 4:04 
GeneralRe: remove or disconnect disk/sotrage Pin
V1rus9r20-Mar-13 6:40
V1rus9r20-Mar-13 6:40 
QuestionAccess VBA Timing Problem Pin
Ingo19-Mar-13 2:12
Ingo19-Mar-13 2:12 
AnswerRe: Access VBA Timing Problem Pin
Dave Kreskowiak19-Mar-13 3:37
mveDave Kreskowiak19-Mar-13 3:37 
GeneralRe: Access VBA Timing Problem Pin
Ingo19-Mar-13 4:41
Ingo19-Mar-13 4:41 
GeneralRe: Access VBA Timing Problem Pin
Dave Kreskowiak19-Mar-13 7:18
mveDave Kreskowiak19-Mar-13 7:18 

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.