Reg:Insert statement in Sql Server2000

Results 1 to 2 of 2

Thread: Reg:Insert statement in Sql Server2000

  1. #1
    Join Date
    Dec 1969

    Default Reg:Insert statement in Sql Server2000

    hi all,<BR>i have a problem with connecting sql server 2000 to<BR>my way of connecting to sql server:-<BR> IN microsoft visual, i opened<BR>server explorer and in that i opened <BR> +servers <BR> -SQlservers<BR> - ulaga
    etsdk<BR><BR>in ulaga
    etsdk<BR>i have created project database.<BR>inside project database i created a table called personal_det<BR><BR>and in coding i am connecting like this:-<BR>MyConnection = New sqlConnection("Server=(local)NetSDK;database=proje ct;Trusted_connection=yes")<BR> Dim InsertCmd As String = "insert into register_tab (name,age) values (@name, @age)"<BR> Dim Mycommand As SqlCommand<BR> Mycommand = New SqlCommand(InsertCmd, MyConnection)<BR><BR> Mycommand.Parameters.Add(New SqlParameter("@name", SqlDbType.Char, 30))<BR> Mycommand.Parameters("@name").Value = txtname.Text<BR><BR> Mycommand.Parameters.Add(New SqlParameter("@age", SqlDbType.Int, 4))<BR><BR> Mycommand.Parameters("@age").Value = txtage.Text<BR><BR><BR> Mycommand.Connection.Open()<BR><BR> <BR> Mycommand.ExecuteNonQuery()<BR><BR>when i execute this code it gives the error like this:-<BR><BR>Server Error in &#039;/ulaga/projecta&#039; Application.<BR>--------------------------------------------------------------------------------<BR><BR>Cannot open database requested in login &#039;project&#039;. Login fails. Login failed for user &#039;ULAGAASPNET&#039;. <BR><BR><BR>Anybody could help me pls in this regard,<BR>ulaga

  2. #2
    Join Date
    Dec 1969

    Default RE: Reg:Insert statement in Sql Server2000

Posting Permissions

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