.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> C# >> Post New QuestionBookmark and Share Subscribe to Forum

How to lock the database programetically using c# + windows application

Posted By: susant     Posted Date: January 05, 2009    Points:2   Category :C#
Hi All

we are working with one project.. the databse name inventory.mdf..
at the time of setup it will copy the databse to mappath and when the user click on logon it will check whether databse is attached or not if not it will attach the databse and allow us to run the application.. ITS WORKING FINE WITH ME..


but the requiremnt like...

How to lock that databse programetically... I mean to say what will be code?? where to write that code..?? to lock the databse....

No can see the stored procedure and tables..

how to do that..

Responses
Author: Praveen             
Posted Date: January 06, 2009     Points: 5   

Well i don't think its possible. In what scenario do you need that? Database is separate program how can you lock pragmatically?

You can lock table while doing insert or update.if this is your requirement let me know.

Author: susant             
Posted Date: January 06, 2009     Points: 5   

Hi praveen..

My requirement like if u r giving a free demo verson to the client for one month.. and we are not providing any security mechanism to the client then he can see all our table structure and storedprocedures....

i studied and find one link like.. if i am creating one user and giving rights to the user that he can open the datbase its working fine.. but if the same user login to sqlexpress without giving his userid and pwd and he will enter to sqlexpress by giving Windows authentication then he can open the databse..

N/way if u can lock the tables also its fine with me for this time.. so help me out..

Author: Vuyiswa Maseko             
Posted Date: January 07, 2009     Points: 5   

As i Said the Approach you took when building your application is not good for the type of application you are trying to build



Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend