I am testing a webservice locally that connects to BankingDb and
check the function
[WebMethod]
public bool CheckPincode(string Pincode)
{
SqlConnection sqlConnection1 =new
SqlConnection(connectionString);
SqlCommand cmd = new SqlCommand("SELECT acc_pincode FROM
Accounts WHERE acc_pincode=@PINCODE",sqlConnection1);
cmd.Parameters.AddWithValue("@PINCODE", Pincode);
sqlConnection1.Open();
Object obj = cmd.ExecuteScalar();
string result = obj.ToString();
sqlConnection1.Close();
if (result == Pincode)
return true;
else
return false;
}
It gives the above exception. how do i fix this ? I think it has
something to with user rights? The table might be created on different
users. How do i find out the users on my db and and create priveleges
and access them etc. etc. and solve my problem.
Pramod Anchuparayil - 28 Jun 2007 23:09 GMT
Make sure you are connecting to the correct server. The error says you are
trying to Access a non existent table.
Also run SQL Trace if you are sure the connection string is correct.
> I am testing a webservice locally that connects to BankingDb and
> check the function
[quoted text clipped - 22 lines]
> users. How do i find out the users on my db and and create priveleges
> and access them etc. etc. and solve my problem.
Milsnips - 29 Jun 2007 07:40 GMT
Hi there,
i've had a similar problem with table access on a web database and it was
the owner of the table, so i added "select * from dbo.[tablename]" and it
solved my problem..
Paul
> I am testing a webservice locally that connects to BankingDb and
> check the function
[quoted text clipped - 22 lines]
> users. How do i find out the users on my db and and create priveleges
> and access them etc. etc. and solve my problem.