Showing posts with label mdf. Show all posts
Showing posts with label mdf. Show all posts

Wednesday, March 28, 2012

microsoft sql database (*.mdf) using help ?

Hi

I use visual std. 2005 and I create a asp.net web page after >add item> sql database > I added my project *.mdf file when I make project my project is runnig with visual studio 2005 but I sent my hostting (internet server )I cant use this mdf file . Are we register this mdf file sqlserver ? can we use this mdf file like access file (mdb ) . What kind of thing I do to use this mdf file .

Thanks

I know some hosts don't support SQL 2005, FastHosts in the UK for exampe have no plans to allow the user of the SQL Express MDF files so it cannot work like an Access MDB file. They say that this is down to performance and security implications.|||

prokurs:

Are we register this mdf file sqlserver ? can we use this mdf file like access file (mdb ) . What kind of thing I do to use this mdf file .

No, you must have a SQL instance on the host to use mdf files. Although in VS2005 you can create mdf files and use them by attaching them to a SQL Express Instance (specified in the Data Source property in your connection string), you still need a SQL Instance to which you have access. So you must have a SQL2005/Express instance on the hosting machine, and then add proper permissions to your account.

|||

hi can you look my mistake this mistake's source ishttp://www.prokurs.com/e/loginana.aspx you can enter this page after write random user name and passwors after then I have got a this mistake please help ?

Server Error in '/' Application.

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

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: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[SqlException (0x80131904): An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +735091 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188 System.Data.SqlClient.TdsParser.Connect(Boolean& useFailoverPartner, Boolean& failoverDemandDone, String host, String failoverPartner, String protocol, SqlInternalConnectionTds connHandler, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject, Boolean aliasLookup) +820 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +628 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +170 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +130 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66 System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +496 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105 System.Data.SqlClient.SqlConnection.Open() +111 System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate) +84 System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +197 System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(String username, Boolean updateLastLoginActivityDate, Int32& status, String& password, Int32& passwordFormat, String& passwordSalt, Int32& failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount, Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDate) +1121 System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat) +105 System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved) +42 System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password) +83 System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +160 System.Web.UI.WebControls.Login.AttemptLogin() +105 System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +99 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35 System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +115 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +163 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102



Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

|||

It is a connection failure, if you're using SQL2000 you need to make sure TCP/IP and Named Pipes network libraries are enabled on the SQL2000 instance via Server Network Utility; in case of SQL2005/Express you can enable the remote connecitons using SQL Server Surface Area. Then rewrite your connection string to point to the correct SQL instance.

If you're using built-in Login Controls (membership provider) in .NET 2.0, you can customize the database connections as mentioned in this article:

http://weblogs.asp.net/scottgu/archive/2005/08/25/423703.aspx

sql

Monday, March 12, 2012

Mgmt Studio

Can I manage MSDE databases in Management Studio? If not, how can I? How
about SQL Express?
When I try to attach an msde.mdf it just gets an "unknown error."
Regards,
Gary BlakelyTry to attach an MSDE MDF file to what?
You can certainly manage existing instances of SQL Server 2000 (including
MSDE). But you're not going to be able to just attach a SQL Server
2000-based mdf (from MSDE or otherwise) to a 2005 instance.
A
"GaryDean" <GaryDean@.newsgroups.nospam> wrote in message
news:OZhDtF5HHHA.4760@.TK2MSFTNGP03.phx.gbl...
> Can I manage MSDE databases in Management Studio? If not, how can I? How
> about SQL Express?
> When I try to attach an msde.mdf it just gets an "unknown error."
> --
> Regards,
> Gary Blakely
>|||Hi Gary,
I am interested in this issue. Would you mind letting me know the result of
the suggestions? If you need further assistance, feel free to let me know.
I will be more than happy to be of assistance.
Have a great day!
Charles Wang
Microsoft Online Community Support

Mgmt Studio

Can I manage MSDE databases in Management Studio? If not, how can I? How
about SQL Express?
When I try to attach an msde.mdf it just gets an "unknown error."
--
Regards,
Gary BlakelyTry to attach an MSDE MDF file to what?
You can certainly manage existing instances of SQL Server 2000 (including
MSDE). But you're not going to be able to just attach a SQL Server
2000-based mdf (from MSDE or otherwise) to a 2005 instance.
A
"GaryDean" <GaryDean@.newsgroups.nospam> wrote in message
news:OZhDtF5HHHA.4760@.TK2MSFTNGP03.phx.gbl...
> Can I manage MSDE databases in Management Studio? If not, how can I? How
> about SQL Express?
> When I try to attach an msde.mdf it just gets an "unknown error."
> --
> Regards,
> Gary Blakely
>|||Hi Gary,
SQL Server 2005 Management Studio totally supports attaching SQL Server
2000, MSDE2000 and SQL Express databases by using sp_detach_db/sp_attach_db
stored procedure.
Please try again via the following:
1. Connect to your MSDE instance, and run the following statement:
use master
go
exec sp_detach_db 'YourDatabaseName'
2. Connect to your SQL Server 2005 instance and run the following statement:
use master
go
exec sp_attach_db @.dbname='DatabaseName',
@.filename1 = N'C:\Program Files\Microsoft SQL
Server\MSSQL$MSDE\Data\test.mdf',
@.filename2 = N'C:\Program Files\Microsoft SQL
Server\MSSQL$MSDE\Data\test_log.ldf'
Could you please mail me (changliw@.microsoft.com) the SQL error logs and a
screenshot of the error message for further research?
By default, the error logs of SQL Server 2005 instance are located in
"C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG". You may check it
if there are multiple instances installed on your computer.
Sincerely yours,
Charles Wang
Microsoft Online Community Support
======================================================When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
======================================================This posting is provided "AS IS" with no warranties, and confers no rights.
======================================================|||Hi Gary,
I am interested in this issue. Would you mind letting me know the result of
the suggestions? If you need further assistance, feel free to let me know.
I will be more than happy to be of assistance.
Have a great day!
Charles Wang
Microsoft Online Community Support

Mgmt Studio

Can I manage MSDE databases in Management Studio? If not, how can I? How
about SQL Express?
When I try to attach an msde.mdf it just gets an "unknown error."
Regards,
Gary Blakely
Try to attach an MSDE MDF file to what?
You can certainly manage existing instances of SQL Server 2000 (including
MSDE). But you're not going to be able to just attach a SQL Server
2000-based mdf (from MSDE or otherwise) to a 2005 instance.
A
"GaryDean" <GaryDean@.newsgroups.nospam> wrote in message
news:OZhDtF5HHHA.4760@.TK2MSFTNGP03.phx.gbl...
> Can I manage MSDE databases in Management Studio? If not, how can I? How
> about SQL Express?
> When I try to attach an msde.mdf it just gets an "unknown error."
> --
> Regards,
> Gary Blakely
>
|||Hi Gary,
SQL Server 2005 Management Studio totally supports attaching SQL Server
2000, MSDE2000 and SQL Express databases by using sp_detach_db/sp_attach_db
stored procedure.
Please try again via the following:
1. Connect to your MSDE instance, and run the following statement:
use master
go
exec sp_detach_db 'YourDatabaseName'
2. Connect to your SQL Server 2005 instance and run the following statement:
use master
go
exec sp_attach_db @.dbname='DatabaseName',
@.filename1 = N'C:\Program Files\Microsoft SQL
Server\MSSQL$MSDE\Data\test.mdf',
@.filename2 = N'C:\Program Files\Microsoft SQL
Server\MSSQL$MSDE\Data\test_log.ldf'
Could you please mail me (changliw@.microsoft.com) the SQL error logs and a
screenshot of the error message for further research?
By default, the error logs of SQL Server 2005 instance are located in
"C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG". You may check it
if there are multiple instances installed on your computer.
Sincerely yours,
Charles Wang
Microsoft Online Community Support
================================================== ====
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
================================================== ====
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== ====
|||Hi Gary,
I am interested in this issue. Would you mind letting me know the result of
the suggestions? If you need further assistance, feel free to let me know.
I will be more than happy to be of assistance.
Have a great day!
Charles Wang
Microsoft Online Community Support

mgmnt studio express won't shrink .ldf files

I'm attempting to truncate/shrink a db (mdf & ldf) to be able to zip it and email it. From Object Explorer I select the db->tasks->shrink->files->filetype->log->release unused spage or reorganize->shrink file to (0mb). This action does not change the size of the .ldf file. Shrinking the mdf works just like SQL 2000 - as expected. Why don't the actions taken do what they imply for the .ldf file? If this is not what the selections mean, what do they mean?

thanks, jack

If you want the LDF to skrink to 0mb then you need to truncate the log because SQL Server in shrink mode reserves what was active log now called virtual log before releasing space to the OS. You can run DBCC Shrinkfile and see what error you get because 2005 now logs the error in the error log. Run a search for DBCC Shrinkfile and Truncate log in the BOL. Hope this helps.

|||Caddre, your response led me to information that explains the 'reality' of dealing with the logfile. In my case since I 'want' an empty db to distribute,I found that I could just detach the db, then delete the .ldf file. When I re-attach a 'new' empty log file is created. -- thanks, jack