Any expert can solve this???

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Aug 2005
Posts: 5
Reputation: BlurStar is an unknown quantity at this point 
Solved Threads: 0
BlurStar BlurStar is offline Offline
Newbie Poster

Any expert can solve this???

 
0
  #1
Feb 17th, 2006
Any expert can solve this??

Error message will occur during execution, is something related to sql. the program will show an error on objcommand.executeNonQuery. Can solve this?

Imports System
Imports System.Data
Imports System.Data.SqlClient

Public Class Form1
Inherits System.Windows.Forms.Form
Dim objConnection As SqlConnection = New _
SqlConnection("server=(local);database=uni;" & _
"Integrated Security=True")
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim objCommand As SqlCommand = New SqlCommand
objCommand.Connection = objConnection

objCommand.CommandText = "INSERT INTO login" & _
"(user,Password)" & _
"VALUES('steven','123456')"
objConnection.Open()
objCommand.ExecuteNonQuery()
objConnection.Close()
End Sub
End Class
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 483
Reputation: campkev is an unknown quantity at this point 
Solved Threads: 19
campkev campkev is offline Offline
Posting Pro in Training

Re: Any expert can solve this???

 
0
  #2
Feb 17th, 2006
what's the error message?
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5
Reputation: BlurStar is an unknown quantity at this point 
Solved Threads: 0
BlurStar BlurStar is offline Offline
Newbie Poster

Re: Any expert can solve this???

 
0
  #3
Feb 17th, 2006
the error message is:
An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll

Additional information: System error.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 206
Reputation: plazmo is an unknown quantity at this point 
Solved Threads: 16
plazmo's Avatar
plazmo plazmo is offline Offline
Posting Whiz in Training

Re: Any expert can solve this???

 
0
  #4
Feb 18th, 2006
Originally Posted by BlurStar
the error message is:
An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll

Additional information: System error.
check your table restraints, like the username might be need to be unique so it cant add the a duplicated key., i had this error and i think that was the problem.
if that is not what is wrong ill try to remeber if it was soemthig else, but im perdy sure its because the database wont let you add it for a reason like duplication.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5
Reputation: BlurStar is an unknown quantity at this point 
Solved Threads: 0
BlurStar BlurStar is offline Offline
Newbie Poster

Re: Any expert can solve this???

 
0
  #5
Feb 20th, 2006
Originally Posted by plazmo
check your table restraints, like the username might be need to be unique so it cant add the a duplicated key., i had this error and i think that was the problem.
if that is not what is wrong ill try to remeber if it was soemthig else, but im perdy sure its because the database wont let you add it for a reason like duplication.
Thank you... you are the only one that help me in this problems.. thanks * 100 :!:
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 1
Reputation: lol_m is an unknown quantity at this point 
Solved Threads: 0
lol_m lol_m is offline Offline
Newbie Poster

Re: Any expert can solve this???

 
0
  #6
Mar 30th, 2007
Originally Posted by plazmo View Post
check your table restraints, like the username might be need to be unique so it cant add the a duplicated key., i had this error and i think that was the problem.
if that is not what is wrong ill try to remeber if it was soemthig else, but im perdy sure its because the database wont let you add it for a reason like duplication.
-------
hey i don'no how to thankful of you , you are my loveeeeeeeeeeeeeeeeeeee
thank really , i challenge with this damn error all over of 2 days
really thx
:cheesy:
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 16,253
Reputation: jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all 
Solved Threads: 542
Moderator
Featured Poster
jbennet's Avatar
jbennet jbennet is offline Offline
Moderator

Re: Any expert can solve this???

 
0
  #7
Mar 30th, 2007
how mucg ram do you have btw?

on less than 256 (512 is better) SQL doesnt play nicely and often gives wierd error messages
If i am helpful, please give me reputation points.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the VB.NET Forum
Thread Tools Search this Thread



Tag cloud for VB.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC