adding in database error

  • (3 Pages)
  • +
  • 1
  • 2
  • 3

38 Replies - 685 Views - Last Post: 03 March 2012 - 10:10 PM Rate Topic: -----

#16 cj777  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 118
  • Joined: 03-March 12

Re: adding in database error

Posted 03 March 2012 - 04:00 AM

View PostnK0de, on 03 March 2012 - 03:44 AM, said:

ah then like I said it can't be .NET framework 4. That method comes with it so that's why the error occurred. I guess we don't have a choice but to switch to your old way of checking Textboxes. Although its hard to say anything more to do from here. If you are okay with it, you can attach your project here so that I can take a look at it.

here you go sir
Was This Post Helpful? 0
  • +
  • -

#17 cj777  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 118
  • Joined: 03-March 12

Re: adding in database error

Posted 03 March 2012 - 04:15 AM

View Postcj777, on 03 March 2012 - 04:00 AM, said:

View PostnK0de, on 03 March 2012 - 03:44 AM, said:

ah then like I said it can't be .NET framework 4. That method comes with it so that's why the error occurred. I guess we don't have a choice but to switch to your old way of checking Textboxes. Although its hard to say anything more to do from here. If you are okay with it, you can attach your project here so that I can take a look at it.

here you go sir

sir it seems like i can't attach any files here can i send it to your email if it is ok to you?
Was This Post Helpful? 0
  • +
  • -

#18 nK0de  Icon User is offline

  • Catch me As Exception
  • member icon

Reputation: 204
  • View blog
  • Posts: 823
  • Joined: 21-December 11

Re: adding in database error

Posted 03 March 2012 - 04:27 AM

zip the project folder and try attaching it again. so that others can check it out too if I'm making a mistake. Or upload it to a file sharing site and share the link here.

This post has been edited by nK0de: 03 March 2012 - 04:28 AM

Was This Post Helpful? 1
  • +
  • -

#19 cj777  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 118
  • Joined: 03-March 12

Re: adding in database error

Posted 03 March 2012 - 04:39 AM

View PostnK0de, on 03 March 2012 - 04:27 AM, said:

zip the project folder and try attaching it again. so that others can check it out too if I'm making a mistake. Or upload it to a file sharing site and share the link here.

kept trying sir but wont work any familiar sharing site that you know sir :sweatdrop:
Was This Post Helpful? 0
  • +
  • -

#20 nK0de  Icon User is offline

  • Catch me As Exception
  • member icon

Reputation: 204
  • View blog
  • Posts: 823
  • Joined: 21-December 11

Re: adding in database error

Posted 03 March 2012 - 04:44 AM

http://www.zippyshare.com/
Was This Post Helpful? 0
  • +
  • -

#21 cj777  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 118
  • Joined: 03-March 12

Re: adding in database error

Posted 03 March 2012 - 04:51 AM

View PostnK0de, on 03 March 2012 - 04:44 AM, said:


here is my file sir http://www41.zippysh...06235/file.html
Was This Post Helpful? 0
  • +
  • -

#22 nK0de  Icon User is offline

  • Catch me As Exception
  • member icon

Reputation: 204
  • View blog
  • Posts: 823
  • Joined: 21-December 11

Re: adding in database error

Posted 03 March 2012 - 05:03 AM

I don't see the code you've posted anywhere in your project! What's the form number where you've written those code?
Was This Post Helpful? 0
  • +
  • -

#23 CharlieMay  Icon User is offline

  • This space intentionally left blank
  • member icon

Reputation: 1397
  • View blog
  • Posts: 4,494
  • Joined: 25-September 09

Re: adding in database error

Posted 03 March 2012 - 05:31 AM

You have in your checks txtTemp.Text but I don't see you doing anything with it. Are you entering a value in txtTemp textbox or is this an oversight?

Edit: Nevermind, maybe I need to let the coffee kick in first :(

This post has been edited by CharlieMay: 03 March 2012 - 05:33 AM

Was This Post Helpful? 0
  • +
  • -

#24 nK0de  Icon User is offline

  • Catch me As Exception
  • member icon

Reputation: 204
  • View blog
  • Posts: 823
  • Joined: 21-December 11

Re: adding in database error

Posted 03 March 2012 - 05:35 AM

View Postcj777, on 03 March 2012 - 01:29 PM, said:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bttadd.Click
        If Me.txtage.Text = "" Or Me.txtheight.Text = "" Or Me.txtweight.Text = "" Or Me.txtabdomen.Text = "" Or Me.txtbp.Text = "" Or Me.txtpr.Text = "" Or Me.txtrr.Text = "" Or Me.txttemp.Text = "" Or txtextrimities.Text = "" Or txtheart.Text = "" Or Me.txtlung.Text Or txtskin.Text = "" Or Me.txtmdiag.Text = "" Or Me.txtremarks.Text = "" Then
            MessageBox.Show("All fields mus not be blank!")
            Exit Sub
        Else
            cls.addcheck(txtage.Text, txtheight.Text, txtweight.Text, txtabdomen.Text, txtbp.Text, txtpr.Text, txtrr.Text, txtextrimities.Text, txtheart.Text, txtlung.Text, txtskin.Text, txtmdiag.Text, txtremarks.Text)

        End If
    End Sub


I found another error here. Check your code. Exactly right here, Me.txtlung.Text. See something missing?

This post has been edited by nK0de: 03 March 2012 - 05:36 AM

Was This Post Helpful? 0
  • +
  • -

#25 cj777  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 118
  • Joined: 03-March 12

Re: adding in database error

Posted 03 March 2012 - 05:46 AM

View PostnK0de, on 03 March 2012 - 05:03 AM, said:

I don't see the code you've posted anywhere in your project! What's the form number where you've written those code?

ive put the code in the form frm checkup sir
Was This Post Helpful? 0
  • +
  • -

#26 cj777  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 118
  • Joined: 03-March 12

Re: adding in database error

Posted 03 March 2012 - 05:55 AM

View PostnK0de, on 03 March 2012 - 05:35 AM, said:

View Postcj777, on 03 March 2012 - 01:29 PM, said:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bttadd.Click
        If Me.txtage.Text = "" Or Me.txtheight.Text = "" Or Me.txtweight.Text = "" Or Me.txtabdomen.Text = "" Or Me.txtbp.Text = "" Or Me.txtpr.Text = "" Or Me.txtrr.Text = "" Or Me.txttemp.Text = "" Or txtextrimities.Text = "" Or txtheart.Text = "" Or [u]Me.txtlung.Text[/u] Or txtskin.Text = "" Or Me.txtmdiag.Text = "" Or Me.txtremarks.Text = "" Then
            MessageBox.Show("All fields mus not be blank!")
            Exit Sub
        Else
            cls.addcheck(txtage.Text, txtheight.Text, txtweight.Text, txtabdomen.Text, txtbp.Text, txtpr.Text, txtrr.Text, txtextrimities.Text, txtheart.Text, [u]txtlung.Text[/u], txtskin.Text, txtmdiag.Text, txtremarks.Text)

        End If
    End Sub


I found another error here. Check your code. Exactly right here, Me.txtlung.Text. See something missing?

i don't get it sir
Was This Post Helpful? 0
  • +
  • -

#27 nK0de  Icon User is offline

  • Catch me As Exception
  • member icon

Reputation: 204
  • View blog
  • Posts: 823
  • Joined: 21-December 11

Re: adding in database error

Posted 03 March 2012 - 05:59 AM

I can't open your project 'cause I'm only using VS2010. And it throws some errors when it is converted.
I don't see a form names frmCheckup in the final clinic folder either.

btw I re-created your situation. Same number of Textboxes, even same names. And used your code to validate. And found that error in my previous post. When it is corrected, it works just fine.

View Postcj777, on 03 March 2012 - 06:25 PM, said:

View PostnK0de, on 03 March 2012 - 05:35 AM, said:

View Postcj777, on 03 March 2012 - 01:29 PM, said:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bttadd.Click
        If Me.txtage.Text = "" Or Me.txtheight.Text = "" Or Me.txtweight.Text = "" Or Me.txtabdomen.Text = "" Or Me.txtbp.Text = "" Or Me.txtpr.Text = "" Or Me.txtrr.Text = "" Or Me.txttemp.Text = "" Or txtextrimities.Text = "" Or txtheart.Text = "" Or [u]Me.txtlung.Text[/u] Or txtskin.Text = "" Or Me.txtmdiag.Text = "" Or Me.txtremarks.Text = "" Then
            MessageBox.Show("All fields mus not be blank!")
            Exit Sub
        Else
            cls.addcheck(txtage.Text, txtheight.Text, txtweight.Text, txtabdomen.Text, txtbp.Text, txtpr.Text, txtrr.Text, txtextrimities.Text, txtheart.Text, [u]txtlung.Text[/u], txtskin.Text, txtmdiag.Text, txtremarks.Text)

        End If
    End Sub


I found another error here. Check your code. Exactly right here, Me.txtlung.Text. See something missing?

i don't get it sir


Me.txtlung.Text = ""
Was This Post Helpful? 1
  • +
  • -

#28 cj777  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 118
  • Joined: 03-March 12

Re: adding in database error

Posted 03 March 2012 - 05:59 AM

View PostCharlieMay, on 03 March 2012 - 05:31 AM, said:

You have in your checks txtTemp.Text but I don't see you doing anything with it. Are you entering a value in txtTemp textbox or is this an oversight?

Edit: Nevermind, maybe I need to let the coffee kick in first :(

I'm entering a value for it sir for temperature
Was This Post Helpful? 0
  • +
  • -

#29 cj777  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 118
  • Joined: 03-March 12

Re: adding in database error

Posted 03 March 2012 - 06:04 AM

View PostnK0de, on 03 March 2012 - 05:59 AM, said:

I can't open your project 'cause I'm only using VS2010. And it throws some errors when it is converted.
I don't see a form names frmCheckup in the final clinic folder either.

btw I re-created your situation. Same number of Textboxes, even same names. And used your code to validate. And found that error in my previous post. When it is corrected, it works just fine.

View Postcj777, on 03 March 2012 - 06:25 PM, said:

View PostnK0de, on 03 March 2012 - 05:35 AM, said:

View Postcj777, on 03 March 2012 - 01:29 PM, said:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bttadd.Click
        If Me.txtage.Text = "" Or Me.txtheight.Text = "" Or Me.txtweight.Text = "" Or Me.txtabdomen.Text = "" Or Me.txtbp.Text = "" Or Me.txtpr.Text = "" Or Me.txtrr.Text = "" Or Me.txttemp.Text = "" Or txtextrimities.Text = "" Or txtheart.Text = "" Or [u]Me.txtlung.Text[/u] Or txtskin.Text = "" Or Me.txtmdiag.Text = "" Or Me.txtremarks.Text = "" Then
            MessageBox.Show("All fields mus not be blank!")
            Exit Sub
        Else
            cls.addcheck(txtage.Text, txtheight.Text, txtweight.Text, txtabdomen.Text, txtbp.Text, txtpr.Text, txtrr.Text, txtextrimities.Text, txtheart.Text, [u]txtlung.Text[/u], txtskin.Text, txtmdiag.Text, txtremarks.Text)

        End If
    End Sub


I found another error here. Check your code. Exactly right here, Me.txtlung.Text. See something missing?

i don't get it sir


Me.txtlung.Text = ""

oh thank you for that sir im rusty at the moment as a beginner but another error was in it
Error converting data type nvarchar to int.
this is my code:
  
Public Function addcheck(ByVal age, ByVal height, ByVal weight, ByVal abdomen, ByVal bp, ByVal pr, ByVal rr, ByVal temp, ByVal extrimities, ByVal heart, ByVal lung, ByVal skin, ByVal meddiagnosis, ByVal remarks)
        Dim cmd As OleDbCommand
        init_con()
        cmd = con.CreateCommand
        cmd.CommandType = CommandType.StoredProcedure
        cmd.CommandText = "addcheck"
        cmd.Parameters.AddWithValue("@age", age)
        cmd.Parameters.AddWithValue("@height", height)
        cmd.Parameters.AddWithValue("@weight", weight)
        cmd.Parameters.AddWithValue("@abdomen", abdomen)
        cmd.Parameters.AddWithValue("@bp", bp)
        cmd.Parameters.AddWithValue("@pr", pr)
        cmd.Parameters.AddWithValue("@rr", rr)
        cmd.Parameters.AddWithValue("@temp", temp)
        cmd.Parameters.AddWithValue("@extrimities", extrimities)
        cmd.Parameters.AddWithValue("@heart", heart)
        cmd.Parameters.AddWithValue("@lung", lung)
        cmd.Parameters.AddWithValue("@skin", skin)
        cmd.Parameters.AddWithValue("@meddiagnosis", meddiagnosis)
        cmd.Parameters.AddWithValue("@remarks", remarks)
        cmd.ExecuteNonQuery()
        con.Close()
        Return 0
    End Function
End Class]

This post has been edited by cj777: 03 March 2012 - 06:09 AM

Was This Post Helpful? 0
  • +
  • -

#30 nK0de  Icon User is offline

  • Catch me As Exception
  • member icon

Reputation: 204
  • View blog
  • Posts: 823
  • Joined: 21-December 11

Re: adding in database error

Posted 03 March 2012 - 06:13 AM

When a datatype you've declared in your Stored Procedure and in your code doesn't match, this error occurs. Debug your code and see which line the error throws first.
Was This Post Helpful? 0
  • +
  • -

  • (3 Pages)
  • +
  • 1
  • 2
  • 3