Showing posts with label everybody. Show all posts
Showing posts with label everybody. Show all posts

Tuesday, March 27, 2012

Attach db failure cause log not primary

Hi Everybody,

I need URGENT help with this. Because of space problem my collegue create a second log file on another drive. I wanted to clean the thing, made a detach, renamed the ldf into old, but now it won't attach anymore, I get the following messages:

EXEC sp_attach_db @.dbname='TARIFINFO_GEN',
@.filename1 = 'F:\Data\TARIFINFO_GEN_Data.mdf'

Server: Msg 5171 F:\Data\TARIFINFO_GEN_log.ldf is not a primary database file
Server: Msg 1813 Device activation error the physical file name 'F:\Data\TARIFINFO_GEN_log.ldf' may be incorrect

Do someone know what to do or where to look for a solution. Many thanks in advance, Isabelle.Try sp_attach_single_file_db 'TARIFINFO_GEN',
'F:\Data\TARIFINFO_GEN_Data.mdf'

Also, in many instances to clean logs you should be able to run something like:

backup log TARIFINFO_GEN with truncate_only

and then a dbcc shrinkfile.

Instead of detaching and re-attaching.

Eric

Thursday, February 16, 2012

ASP.NET SQL Server Setup: stores one created database information for ASP.NET applications servi

Hi everybody,

o.k, with the aspnet_regsql wizard it′s easy to configure a SQL Server database that stores information for ASP.NET applications services. I did it for my database AppServicesDB.

In VS2005 I wrote 2 applications using the same AppServicesDB as Membership-Provider.

When I use the web admin tool ASP.NET Configuration for the first application, I created the roles and users for this first application. All looks to be o.k.

But when I used ASP.NET Configuartion for the second application (pointing in at the same AppServiesDB), the roles and useres of the first application are visible as if they are members of the second application.

Questions:
Is it possible or necessary to configure many databases (with aspnet_regsql) for every single application on a machine, so that on the machines SQL server exists many databases for ASP.NET applications services?
Or is only one database responsible for the machines SQL Server to be the memebership-Provider for all applications?

Thanks for help, support, assistance...

I guess it would be better to post this on ASP.NET forums. This forum is for answering questions related to CLR Integration in SQL Server 2005.

Thanks,
-Vineet.

Sunday, February 12, 2012

asp.net and sql 2000 question

Hi everybody///
When i try to connect to my database to select some data it gives me and error:

_______________________________________________________________________________________________________________

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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

Source Error:

Line 48: dataAdapter.SelectCommand = dbCommandLine 49: Dim dataSet As System.Data.DataSet = New System.Data.DataSetLine 50: dataAdapter.Fill(dataSet, "profiles")
Line 51:
Line 52:


Source File: C:\Documents and Settings\rwoodard.MSBML_REGGIE\My Documents\Visual Studio 2005\WebSites\WebSite1\App_Code\author.vb Line: 50

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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +117 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +346 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) +1093 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +1083 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +272 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +688 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +82 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +558 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +126 System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +651 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +160 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +122 System.Data.SqlClient.SqlConnection.Open() +229 System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState) +49 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +162 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +308 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +152 AuthorsDB.GetStates() in C:\Documents and Settings\rwoodard.MSBML_REGGIE\My Documents\Visual Studio 2005\WebSites\WebSite1\App_Code\author.vb:50[TargetInvocationException: Exception has been thrown by the target of an invocation.] System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) +0 System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) +72 System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) +296 System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +29 System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +17 System.Web.UI.WebControls.ObjectDataSourceView.InvokeMethod(ObjectDataSourceMethod method, Boolean disposeInstance, Object& instance) +676 System.Web.UI.WebControls.ObjectDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +2664 System.Web.UI.WebControls.ListControl.OnDataBinding(EventArgs e) +65 System.Web.UI.WebControls.ListControl.PerformSelect() +32
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +99
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +92
System.Web.UI.WebControls.BaseDataBoundControl.OnPreRender(EventArgs e) +33
System.Web.UI.WebControls.ListControl.OnPreRender(EventArgs e) +31
System.Web.UI.Control.PreRenderRecursiveInternal() +148
System.Web.UI.Control.PreRenderRecursiveInternal() +233
System.Web.UI.Control.PreRenderRecursiveInternal() +233
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4437



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

But I am using sqlserver 2000 instead. I have the correct connection string and i have used my sa account and another account i created. Can anyone tell me why i am getting this error.do you have TCP/IP activated as a connection method to the sql server?|||I believe i do. I went to the network server utility and it had the tcp/ip enabled as well as the namepipe.|||hey augustwind i think i figured out my problem. I had opened the server network port(2051) in my firewall but i didn't open the client port (1433). I went and opened it and now it is connecting to my database.

I was wondering if you could answer another question for me.

I am trying to make a page to search my database based on the information input in to some text boxes on the web page. I have a gridview control and an objectdatasource control. I don't want to display anything from the database until someone enters the data into the text boxes and hit the search button from the form.

I am confused as to how to do this because i think that on loading the page the object datasource kicks in and tries to get information to pull the data from the database, however there is nothing in the textboxes at that point so you know that the dataset that I return is empty and it gives an error because the parameter is blank. Is there a way to make it so the page will load but will not display and data from the database until the textboxes are filled out