Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
hemaljoes
Starting Member
7 Posts |
Posted - 2010-08-06 : 05:02:47
|
| Hi,I want to Execute a GRANT query from my ASP.net page. I can successfully execute the following command from a ASP pagesqlCommand.CommandText = "CREATE LOGIN [DomainName\\UserName] FROM WINDOWS";sqlCommand.ExecuteNonQuery();But i want to execute something like belowsqlCommand.CommandText = "CREATE LOGIN ["+txtNewUser.Text+"] FROM WINDOWS";sqlCommand.ExecuteNonQuery();Thanks in advanced |
|
|
kashyap_sql
Posting Yak Master
174 Posts |
Posted - 2010-08-06 : 07:21:28
|
| elaborate your needWith RegardsKashyap M |
 |
|
|
hemaljoes
Starting Member
7 Posts |
Posted - 2010-08-06 : 07:31:21
|
| I am making an ASP.net web application.In this applications high previladge user can add new user.For a example CEO can make new users.Then CEO should be able to give permision to the user to access the database and there after for tables and SPs. This permision grant should be done from ASP.net page without going to SQL Server Managment studio and grant permission.As the first step i am trying to make Login to the database from the ASP.net page.Thanks. |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2010-08-06 : 13:29:52
|
quote: Originally posted by hemaljoes I am making an ASP.net web application.In this applications high previladge user can add new user.For a example CEO can make new users.Then CEO should be able to give permision to the user to access the database and there after for tables and SPs. This permision grant should be done from ASP.net page without going to SQL Server Managment studio and grant permission.As the first step i am trying to make Login to the database from the ASP.net page.Thanks.
CROSS POSTYou should create Roles...and in any case, your application should be creating Application Users in the database, not SQL Server usersBrett8-)Hint: Want your questions answered fast? Follow the direction in this linkhttp://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspxAdd yourself!http://www.frappr.com/sqlteam |
 |
|
|
|
|
|