Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6577791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:41:04+00:00 2026-05-25T15:41:04+00:00

I am developing an ASP.Net website. I have to execute a query which fetches

  • 0

I am developing an ASP.Net website. I have to execute a query which fetches data from two different database.

I have two SqlConnection objects for these connections.

I have both the connections open. But in SqlCommand object, I can specify just one SqlConnection object.

     SqlConnection conn = new SqlConnection("Data Source=xxx;Initial Catalog=xxx1;User ID=web_writeonly;Password=aaa;Network Library=DBMSSOCN");
     SqlConnection conn1 = new SqlConnection("Data Source=xxx;Initial Catalog=xxx2;User ID=randomUser;Password=bbb;Network Library=DBMSSOCN");

       conn.open();

       conn1.open();

       SqlCommand cmdUserInfo = new SqlCommand("<query goes here>", conn);
    cmdUserInfo.Parameters.Add("@ifa", SqlDbType.NVarChar).Value = ifacode;
    SqlDataAdapter sdaUserInfo = new SqlDataAdapter(cmdUserInfo);
    sdaUserInfo.Fill(dtSummaryTbl);

    conn.Close();
    conn1.Close();

When I execute this code snippet, I get an error “The SELECT permission was denied on the object ‘*‘, database ‘xxx2’, schema ‘dbo’.”

Please help me out in sorting this problem.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T15:41:04+00:00Added an answer on May 25, 2026 at 3:41 pm

    That error means that you don’t have sufficient permissions… check what sql login your website is associated with and then the permissions on the table you’re trying to select data from.

    Also, on closer inspection, one of your usernames is “web_writeonly“… kind of a hint if you’re trying to do a select!!! 😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

TGIF, I have a website I'm developing which is using ASP.NET masterpage/sitemap/content pages setup.
I'm developing a website (using asp.net-mvc) with a SqlServer 2005 database. I have numerous
I am developing an ASP.NET 2.0 website. I have created data access and business
I am developing a website by ASP.Net. I have created settings/first-run page which I
i have a problem i am developing an asp.net mvc project. Website is in
I'm developing a new ASP .NET website which is effectively a subset of the
I have an asp.net c# website I'm developing with Visual Web Developer Express Edition
I have an asp.net website that stores events inside a database table. Then I
Hai I am developing an C# application(not asp.net) in which I have to get
We have a large ASP.Net website that has a single css stylesheet which is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.