HI I'M NEWBIES in visual Basic with Sql Server
i try to make a database with stored procedure and whan i run the program the give an error
"Invalid object name 'Product'."
i dont know how to fix it here is my code
Dim sqlcon As New SqlClient.SqlConnection
sqlcon.ConnectionString = "Data Source=WISEMAN\SQLEXPRESS;Initial Catalog=Product;Integrated Security=True;Pooling=False;uid=uid;pwd=pwd "
Dim cmd As New SqlClient.SqlCommand
cmd.Connection = sqlcon
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "insertcustomer"
cmd.Parameters.AddWithValue("@Productid", TextBox1.Text)
cmd.Parameters.AddWithValue("@detail", TextBox2.Text)
sqlcon.Open()
cmd.ExecuteScalar()
cmd.ExecuteNonQuery()
sqlcon.Close()
the error at line is cmd.executescalar()
My database name is product
my name for my storedprocedure is insertcustomer
Code for insertcustomer
ALTER PROCEDURE dbo.InsertCustomer
(
@ProductID int output,
@detail varchar(50)
)
AS
SET NOCOUNT ON
INSERT INTO Productdetail
(detail)
VALUES
(@detail);
IF @@ROWCOUNT>0 AND @@ERROR>0
SELECT @Detail = detail
From Productdetail
Where (ProductID =SCOPE_IDENTITY())
if u have any idee please tell me