Servergrid UserLink

... connection ... education ... discovery ... information ...
Welcome to Servergrid UserLink Sign in | Join | Help
in
Home Blogs Forums Photos Downloads Servergrid Join Now Private Messages

denied in database 'master' attach MDF

Last post 08-17-2008, 3:56 AM by asemon. 0 replies.
Sort Posts: Previous
  • denied in database 'master' attach MDF

     08-17-2008, 3:56 AM

    • Joined on 08-17-2008
    • Posts 1
    • Points 5
    • Top 200 Contributor

    hi

     

    i went to attach MDF file with asp.net code

     

    Dim sqlcon AsNew System.Data.SqlClient.SqlConnection("Server=mssql6.fsecurity.net;Database=usernam_i_database;User ID=usernam_i;Password=123456;Trusted_Connection=False;")
    Dim sqlcmd AsNew System.Data.SqlClient.SqlCommand("sp_attach_db", sqlcon)
    sqlcmd.CommandType = System.Data.CommandType.StoredProcedure
    sqlcmd.Parameters.Add(
    "@dbname", System.Data.SqlDbType.NVarChar, 300).Value = "usernam_i_database"
    sqlcmd.Parameters.Add("@filename1", System.Data.SqlDbType.NVarChar, 300).Value = "D:\hshome\username\fsaxi.com\App_Data\Database.mdf"
    sqlcmd.Parameters.Add("@filename2", System.Data.SqlDbType.NVarChar, 300).Value = "D:\hshome\username\fsaxi.com\App_Data\Database_log.ldf"
    sqlcon.Open()
    sqlcmd.ExecuteNonQuery()

    but i have this error

    CREATE DATABASE permission denied in database 'master'

    how i can selove this problem? 

     

View as RSS news feed in XML
Powered by Community Server, by Telligent Systems