473,406 Members | 2,633 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Invalid object name 'Accounts' <tablename>

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.

Jun 28 '07 #1
2 2886
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.
"weird0" <am********@gmail.comwrote in message
news:11*********************@w5g2000hsg.googlegrou ps.com...
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.
Jun 28 '07 #2
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

"weird0" <am********@gmail.comwrote in message
news:11*********************@w5g2000hsg.googlegrou ps.com...
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.

Jun 29 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

24
by: jason | last post by:
Hi Ray...a while ago you explained an elegant solution to enable me to CREATE and EDIT existing tables and queries inside my online access 2000 database.... could you provide refresher links on...
2
by: Dave Moore | last post by:
Hi, I want to use CSS to define the font size in every cell of a table. This avoids needing to define the font size in every <TD> tag using the normal multiple HTML <FONT SIZE="2"> notation....
1
by: Ed Bacon | last post by:
I am trying to produce a generic "audit report" for various transactions in our application. Each transaction type defines a document (and has an associated schema). When a transaction leads to a...
0
by: Frank van Vugt | last post by:
L.S. Postgresql version 7.4.3 does not allow declaration of a 'for each statement' constraint trigger: db=# \h create constraint Command: CREATE CONSTRAINT TRIGGER Description: define a...
6
by: Marcel Hug | last post by:
Hi all ! I have a table in my database, which has 3 attributes. IDFailureControl, ControlDate and ControlVersion. In the following function I test, if the date of today allready exists. Then I...
2
by: Adrien Reboisson | last post by:
I'm trying to build a basic DB explorer using C# & Visual Studio 2005. I installed SQL Server 2005 Express, created a blank project, dropped a TreeView, a ListView and a DataGridView : DB objects...
0
by: sphinney | last post by:
I have a complex Access 2002 database with multimple tables, queries, forms, and reports. The database is used by miltiple users that have one of four different levels of security. The databae uses...
3
oll3i
by: oll3i | last post by:
package ejb; import javax.ejb.EJBObject; import java.rmi.RemoteException; import java.sql.Connection; import java.util.Map; public interface InterfaceRemote extends EJBObject { public Map...
5
by: matt | last post by:
This is a strange one but I've been stuck on it for days. Any help appreciated. THE PLAN: I've a database that I use a script to grab all the entries for a particular field. I then want to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.