You must Sign In to post a response.
  • Category: ASP.NET

    Am getting this error while run in local iis

    this is my error


    Server Error in '/RYZ' Application.

    SELECT permission denied on object 'EmpReg', database 'reyas', schema 'dbo'.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Data.SqlClient.SqlException: SELECT permission denied on object 'EmpReg', database 'reyas', schema 'dbo'.

    Source Error:

    Line 84: catch (Exception e)
    Line 85: {
    Line 86: throw e;
    Line 87: }
    Line 88: finally

    Source File: d:\bramandam site\App_Code\Marvel.cs Line: 86

    Stack Trace:

    [SqlException (0x80131904): SELECT permission denied on object 'EmpReg', database 'reyas', schema 'dbo'.]
    Marvel.GETDS(String qry) in d:\bramandam site\App_Code\Marvel.cs:86
    Attendance.idwer() in d:\bramandam site\Attendance.aspx.cs:360
    Attendance.TextBox3_TextChanged(Object sender, EventArgs e) in d:\bramandam site\Attendance.aspx.cs:373
    System.Web.UI.WebControls.TextBox.OnTextChanged(EventArgs e) +107
    System.Web.UI.WebControls.TextBox.RaisePostDataChangedEvent() +134
    System.Web.UI.WebControls.TextBox.System.Web.UI.IPostBackDataHandler.RaisePostDataChangedEvent() +10
    System.Web.UI.Page.RaiseChangedEvents() +165
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3135

    Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
  • #763034
    Hi selvi,

    It seems you don't have an access to get data from the "EmpReg" database. First off all you need to get permission then access the same.

    Hope you got my point..

    --------------------------------------------------------------------------------
    Give respect to your work, Instead of trying to impress your boss.

    N@veen
    Blog : http://naveens-dotnet.blogspot.in/

  • #763036
    Hello Selvi,

    SELECT permission denied on object 'EmpReg', database 'reyas', schema 'dbo'. means you don't have the permission to access the object named 'EmpReg'. You must have to get the access first.

    I think the problem is with the user having deny privileges. This error comes when the user which you have created does not have the sufficient privileges to access your tables in the database. Do grant the privilege to the user in order to get what you want.

    GRANT the user specific permissions such as SELECT, INSERT, UPDATE and DELETE on tables in that database.

    GRANT INSERT, UPDATE, SELECT ON EmpReg TO User1

    Than try it. Surely it will work for you.

    Hope you understand.

    Regards,
    Nirav Lalan
    DNS Gold Member
    "Failure is the path of least persistence"

  • #763040
    but user 1 is what sir

  • #763041
    Hello Selvi,

    User 1 means the user who is executing the statements. Like INSERT, UPDATE, SELECT, DELETE, etc.

    Regards,
    Nirav Lalan
    DNS Gold Member
    "Failure is the path of least persistence"

  • #763043
    sorry i cannot understand it . reyas this is my database name

  • #763044
    Hello Selvi,

    Can you show us the connection string you have used in your application. Now than only we tell you what you have to do now. Because you didn't understand what we wanted say.

    Paste your connection string in new response.

    Regards,
    Nirav Lalan
    DNS Gold Member
    "Failure is the path of least persistence"

  • #763045
    Hi selvi,

    Remember onething to access tables first we need database permission then if they integrated permission level for table then get those permission and if they integrated permission level to perform CRUD operations against that table and user then get those permission. If you got all those then your problem has been resolved, first check with your database administrator to resolve this error.

    --------------------------------------------------------------------------------
    Give respect to your work, Instead of trying to impress your boss.

    N@veen
    Blog : http://naveens-dotnet.blogspot.in/

  • #763059
    Hi

    Do one thing

    Step1:

    Create new database backup and restore from your old db and try them

    Step 2:

    try to get db script from your old db and run new db


    Step3:

    Right Click your connection string go to properties

    set permission grant all in your db objects

    Name : Dotnet Developer-2015
    Email Id :kumaraspcode2009@gmail.com

    'Not by might nor by power, but by my Spirit,' says the LORD Almighty.


Sign In to post your comments