Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / June 2007

Tip: Looking for answers? Try searching our database.

Invalid object name 'Accounts' <tablename>

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
weird0 - 28 Jun 2007 20:21 GMT
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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.