Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Dec 16, 2010 10:38 PM by KenNichols
Apr 15, 2008 08:59 PM|LINK
i'm developing a website using visual studio 2005, when i run it from VS it works fine and it can access the DB.
but when i make an alias and run it directly from localhost ..i keep getting this message when i try to fill a DATASET ..
Line 198: cmd.CommandText = "Select Line From Buses";Line 199: da.SelectCommand = cmd; Line 200: da.Fill(ds);
Apr 15, 2008 09:12 PM|LINK
Hi, we need to check the connection information, how are you connecting. Its obvious that different information/user is taken one is going thru and other is complaining.
Could you let us know about ur connection string.
Apr 15, 2008 09:26 PM|LINK
try to run the following though sql management studio (replace tblYourTableName with your table name)
grant select on dbo.tblYourTableName to public
Apr 16, 2008 11:11 AM|LINK
hi again, thx 4 reply.
this is the connection string ...i haven't made any users attached to the DB or anything ..
connectionString="Data Source=MAJD\SQLEXPRESS;Initial Catalog=MobileStudentPortal;Integrated Security=True"
Apr 16, 2008 11:19 AM|LINK
Add the user ASPNET user to the SQL Server, and add it as a user to the database, with appropriate permissions.
Apr 16, 2008 11:23 AM|LINK
I fixed the error by assigning the default schema for the database to DBO.
eg: Login to SQL using SA > Security > User > select username > properties
Make sure that 'Users = username' & 'Schema = DBO'
Apr 17, 2008 08:17 PM|LINK
how can i login to SQL as SA ?
i'm SQL management studio ..please explain me how !
Apr 18, 2008 04:18 AM|LINK
You can login using windows authentication also.
Apr 19, 2008 06:13 PM|LINK
Apr 21, 2008 02:20 AM|LINK
Hi majd_wadi ,
I did what u said, still not working !!!!!!! the problem is that when i run from VS2005 it works fine ..but when i make an alias and run it through local host directly it doesn't work !!!!???
So, after you have add the asp.net working process account (generally speaking aspnet in xp box and network service in a server box) into your sql server permission list, you still cannot access the database. Do I understand you right? If yes, I think then
you need to check if you have set "immpersonate" in your asp.net authentication configuration (in web.config, check if this tag <identity immpersonate="true"> exist). If yes, you need to make sure that the login account which asp.net immersonated has accutall
got the permission right to access your db.
Hope my suggestion helps