Results 1 to 12 of 12

Thread: [2005] VS.net 2005 BUG???

  1. #1

    Thread Starter
    PowerPoster Simply Me's Avatar
    Join Date
    Aug 2003
    Posts
    2,748

    [2005] VS.net 2005 BUG???

    Hi! I wonder if this is a bug... I kept getting these errors from time to time but I cant single out what's causing it.

    My proj runs on a network and this happens when the user will click a save button to save records in the database (data table). Is this a bug?? if not, can someone please help me out in fixing these errors?

    Attached are the errors I get and if it will help. this is how I accessed my database as well as how I save the records.

    vb Code:
    1. Private Sub btnDisplay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplay.Click
    2.         SuspendLayout()
    3.         cnn.ConnectionString = "Data Source=.\sqlexpress;Initial Catalog=MYDB;Integrated Security=True"
    4.  
    5.         If cnn.State = ConnectionState.Closed Then cnn.Open()
    6.  
    7.  
    8.         cmdGrade = cnn.CreateCommand
    9.         cmdGrade.CommandText = "SELECT DISTINCT * FROM tblEnrol WHERE SectionName = '" & cboSection.Text & "' AND SubjectName = '" & cboSubjectName.Text & "' AND YearLevel = '" & cboYearLevel.Text & "'"
    10.         daGrade.MissingSchemaAction = MissingSchemaAction.AddWithKey
    11.         dsGrade.Clear()
    12.         'dsSection.Clear()
    13.         'dsSubject.Clear()
    14.         daGrade.SelectCommand = cmdGrade
    15.         daGrade.Fill(dsGrade, "tblEnrol")
    16.         cnn.Close()
    17.  
    18.  
    19.  
    20.         Dim si() As FarPoint.Win.Spread.SortInfo = New FarPoint.Win.Spread.SortInfo() {New FarPoint.Win.Spread.SortInfo(1, True), New FarPoint.Win.Spread.SortInfo(2, True)}
    21.  
    22.         ''HideSheets()
    23.  
    24.         'bind fpspread1 to datasource
    25.         '1st Grading
    26.         FpSpread1.Sheets(0).DataSource = dsGrade
    27.         FpSpread1.Sheets(0).DataMember = "tblEnrol"
    28.  
    29.         'Create CellType and specify number decimal for 1st grading sheet
    30.         With FpSpread1.Sheets(0)
    31.             .DataAutoCellTypes = False
    32.             Dim num As New FarPoint.Win.Spread.CellType.NumberCellType
    33.             num.DecimalPlaces = 0
    34.             .Columns(12, 81).CellType = num 'column 12 to 81
    35.             .Columns(84, 85).CellType = num
    36.             .Columns(88, 89).CellType = num
    37.             .Columns(92, 93).CellType = num
    38.             .Columns(96, 97).CellType = num
    39.             .Columns(100, 101).CellType = num
    40.             .Columns(104, 105).CellType = num
    41.             .Columns(109).CellType = num
    42.  
    43.             'sort multi-column
    44.             .SortRows(0, FpSpread1.Sheets(0).RowCount, si)
    45.  
    46.         End With
    47.         FormatSpread()
    48.  
    49.         'bind FpSpread1.Sheets(1) to datasource
    50.         '2nd Grading
    51.         FpSpread1.Sheets(1).DataSource = dsGrade
    52.         FpSpread1.Sheets(1).DataMember = "tblEnrol"
    53.  
    54.         'Create CellType and specify number decimal for 1st grading sheet
    55.         With FpSpread1.Sheets(1)
    56.             .DataAutoCellTypes = False
    57.             Dim num As New FarPoint.Win.Spread.CellType.NumberCellType
    58.             num.DecimalPlaces = 0
    59.  
    60.             'for 2nd grading cell type
    61.             .Columns(135, 204).CellType = num 'Assignment to Total Score (A)
    62.             .Columns(207, 208).CellType = num 'Total Quiz to Total Score (Q)
    63.             .Columns(211, 212).CellType = num 'Total Rec to Total Score (R)
    64.             .Columns(215, 216).CellType = num 'Total Proj to Total Score (P)
    65.             .Columns(219, 220).CellType = num 'Total Speech to Total Score (SP)
    66.             .Columns(223, 224).CellType = num 'Total Reading to Total Score (RDG)
    67.             .Columns(227, 228).CellType = num 'Total Exam to Total Score (E)
    68.             .Columns(232).CellType = num 'Average
    69.         End With
    70.         FormatSpread1()
    71. End Sub

    vb Code:
    1. Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
    2.         'SuspendLayout()
    3.          dsGrade = CType(FpSpread1.ActiveSheet.DataSource, System.Data.DataSet)
    4.  
    5.         'Save the changes back to the database
    6.         Try
    7.             daGrade.Update(dsGrade.Tables("tblEnrol"))
    8.             dsGrade.AcceptChanges()
    9.             FormatSpread()
    10.             FormatSpread1()
    11.             formatspread2()
    12.             FormatSpread3()
    13.             formatspread4()
    14.             FormatSpread5()
    15.  
    16.             formatspread7()
    17.             formatspread11()
    18.  
    19.             MessageBox.Show("Changes are comitted to the database")
    20.         Catch ex As Exception
    21.             MessageBox.Show(ex.ToString)
    22.         End Try
    23.  
    24.         ' ResumeLayout()
    25.     End Sub
    Attached Images Attached Images   
    To give is always to be NOBLE...
    To received is always to be BLESSED....
    Each day strive to be NOBLE
    Each day strive to be BLESSED

    If this post has helped you. Please take time to rate it.

    >=|+|=< Simply Me >=|+|=<

    ----------------------------------------
    Connection Strings | Number Only in Textbox | Splash Screen with Progress Bar | Printing to 1/2 of perforated bond paper |
    Freeze 2005 DataGridView Column

  2. #2

  3. #3
    Hyperactive Member
    Join Date
    Jul 2005
    Location
    In A House :)
    Posts
    291

    Re: [2005] VS.net 2005 BUG???

    you need to look at frmHS lines 211 and 213, it appears to be something with your data but i coudn't make out all the info in the errors.
    --"Tap Dancing On The Brittle Edge Of Sanity"--

  4. #4
    PowerPoster Jenner's Avatar
    Join Date
    Jan 2008
    Location
    Mentor, OH
    Posts
    3,712

    Re: [2005] VS.net 2005 BUG???

    Well, "DataTable Internal Index is Corrupt" and "Concurrency Violation" sound like an error in the database.
    My CodeBank Submissions: TETRIS using VB.NET2010 and XNA4.0, Strong Encryption Class, Hardware ID Information Class, Generic .NET Data Provider Class, Lambda Function Example, Lat/Long to UTM Conversion Class, Audio Class using BASS.DLL

    Remember to RATE the people who helped you and mark your forum RESOLVED when you're done!

    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe. "
    - Albert Einstein

  5. #5

    Thread Starter
    PowerPoster Simply Me's Avatar
    Join Date
    Aug 2003
    Posts
    2,748

    Re: [2005] VS.net 2005 BUG???

    Quote Originally Posted by DirtyHowi
    you need to look at frmHS lines 211 and 213, it appears to be something with your data but i coudn't make out all the info in the errors.
    this the code where lines 211 and 213.
    Code:
           'Save the changes back to the database        
    Try            
    daGrade.Update(dsGrade.Tables("tblEnrol"))            
    dsGrade.AcceptChanges()
    To give is always to be NOBLE...
    To received is always to be BLESSED....
    Each day strive to be NOBLE
    Each day strive to be BLESSED

    If this post has helped you. Please take time to rate it.

    >=|+|=< Simply Me >=|+|=<

    ----------------------------------------
    Connection Strings | Number Only in Textbox | Splash Screen with Progress Bar | Printing to 1/2 of perforated bond paper |
    Freeze 2005 DataGridView Column

  6. #6

    Thread Starter
    PowerPoster Simply Me's Avatar
    Join Date
    Aug 2003
    Posts
    2,748

    Re: [2005] VS.net 2005 BUG???

    Quote Originally Posted by Jenner
    Well, "DataTable Internal Index is Corrupt" and "Concurrency Violation" sound like an error in the database.
    Im confused why this is displaying....If I close my form and try to enter values again and then save, i dont get the error....changes are saved and sometimes i get the error...
    To give is always to be NOBLE...
    To received is always to be BLESSED....
    Each day strive to be NOBLE
    Each day strive to be BLESSED

    If this post has helped you. Please take time to rate it.

    >=|+|=< Simply Me >=|+|=<

    ----------------------------------------
    Connection Strings | Number Only in Textbox | Splash Screen with Progress Bar | Printing to 1/2 of perforated bond paper |
    Freeze 2005 DataGridView Column

  7. #7
    Registered User nmadd's Avatar
    Join Date
    Jun 2007
    Location
    U.S.A.
    Posts
    1,676

    Re: [2005] VS.net 2005 BUG???

    1) Here is a massive thread on the corrupted index error. I haven't read it all. Hope it helps. http://forums.microsoft.com/MSDN/Sho...77680&SiteID=1

    2) Just taking a shot here: Are you trying to Update an auto-incremented field?

  8. #8

    Thread Starter
    PowerPoster Simply Me's Avatar
    Join Date
    Aug 2003
    Posts
    2,748

    Re: [2005] VS.net 2005 BUG???

    Quote Originally Posted by nmadd
    1) Here is a massive thread on the corrupted index error. I haven't read it all. Hope it helps. http://forums.microsoft.com/MSDN/Sho...77680&SiteID=1

    2) Just taking a shot here: Are you trying to Update an auto-incremented field?
    I've seen the link already...It seems that Microsoft has not solved this problem yet....

    And yes I have an auto-increment field in my table.
    To give is always to be NOBLE...
    To received is always to be BLESSED....
    Each day strive to be NOBLE
    Each day strive to be BLESSED

    If this post has helped you. Please take time to rate it.

    >=|+|=< Simply Me >=|+|=<

    ----------------------------------------
    Connection Strings | Number Only in Textbox | Splash Screen with Progress Bar | Printing to 1/2 of perforated bond paper |
    Freeze 2005 DataGridView Column

  9. #9
    Frenzied Member MaximilianMayrhofer's Avatar
    Join Date
    Aug 2007
    Location
    IM IN YR LOOP
    Posts
    2,001

    Re: [2005] VS.net 2005 BUG???

    What he is asking is, are you perhaps unwittingly attempting to manually assign a value to an autonumber field in your update statement?

  10. #10

    Thread Starter
    PowerPoster Simply Me's Avatar
    Join Date
    Aug 2003
    Posts
    2,748

    Re: [2005] VS.net 2005 BUG???

    nope im not manually assigning value to autonumber field. As you can see in my post#5, I just use
    Code:
    daGrade.Update(dsGrade.Tables("tblEnrol"))            
    dsGrade.AcceptChanges()
    To give is always to be NOBLE...
    To received is always to be BLESSED....
    Each day strive to be NOBLE
    Each day strive to be BLESSED

    If this post has helped you. Please take time to rate it.

    >=|+|=< Simply Me >=|+|=<

    ----------------------------------------
    Connection Strings | Number Only in Textbox | Splash Screen with Progress Bar | Printing to 1/2 of perforated bond paper |
    Freeze 2005 DataGridView Column

  11. #11
    Frenzied Member MaximilianMayrhofer's Avatar
    Join Date
    Aug 2007
    Location
    IM IN YR LOOP
    Posts
    2,001

    Re: [2005] VS.net 2005 BUG???

    You are using daGrade.Update(), but where in your code have you actually assigned an update command to daGrade?

  12. #12

    Thread Starter
    PowerPoster Simply Me's Avatar
    Join Date
    Aug 2003
    Posts
    2,748

    Re: [2005] VS.net 2005 BUG???

    Quote Originally Posted by MaxMayrhoferTemp
    You are using daGrade.Update(), but where in your code have you actually assigned an update command to daGrade?
    Im not sure what you mean but I have declared the following
    Code:
        Dim cnn As New SqlConnection
        Dim cmdGrade As New SqlCommand
        Dim daGrade As New SqlDataAdapter
        Dim builder As New SqlCommandBuilder(daGrade)
    Last edited by Simply Me; Aug 25th, 2008 at 06:34 PM.
    To give is always to be NOBLE...
    To received is always to be BLESSED....
    Each day strive to be NOBLE
    Each day strive to be BLESSED

    If this post has helped you. Please take time to rate it.

    >=|+|=< Simply Me >=|+|=<

    ----------------------------------------
    Connection Strings | Number Only in Textbox | Splash Screen with Progress Bar | Printing to 1/2 of perforated bond paper |
    Freeze 2005 DataGridView Column

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width