Is This SQL Stored Prodcedure Is Valid
Jan 30, 2004
what i want to achive is the proc sh'd return a master-detail value in one go.
master value should be returned with Out Parameter and detail value as a recordset.
will it return the recordset of detail table as below....
Create Procedure ProductDetail
(
@ProductID int,
@ProductCode varchar(15) OUTPUT,
@ProductName varchar(60) OUTPUT,
@CategoryID int OUTPUT,
@CategoryName varchar(60) OUTPUT,
@Image1 varchar(256) OUTPUT,
@Image2 varchar(256) OUTPUT,
@UnitPrice smallmoney OUTPUT,
@UOMValue numeric(9) OUTPUT,
@UOMName varchar(10) OUTPUT,
@ShippingWeight numeric(9) OUTPUT,
@Directions varchar(1500) OUTPUT,
@Ingrediants varchar(1500) OUTPUT,
@Warnings varchar(1500) OUTPUT,
@ShortDescription varchar(1000) OUTPUT,
@LongDescription varchar(2000) OUTPUT,
@NutritionFacts varchar(1000) OUTPUT,
@SearchKeywords varchar(500) OUTPUT,
@IsTaxable varchar(15) OUTPUT,
@CreatedBy varchar(60) OUTPUT,
@CreatedOn varchar(15) OUTPUT,
@UpdatedBy varchar(60) OUTPUT,
@UpdatedOn varchar(15) OUTPUT,
@Status int OUTPUT
)
AS
SELECT
@ProductCode = ProductCode,
@ProductName = ProductName,
@CategoryID = CategoryID,
@CategoryName = (select CategoryName from mCategory where CategoryID=a.CategoryID),
@Image1 = isnull(Image1,''),
@Image2 = isnull(Image1,''),
@UnitPrice = isnull(UnitPrice,0),
@UOMValue = isnull(UOMValue,0),
@UOMName = isnull(UOMName,''),
@ShippingWeight = isnull(ShippingWeight,0),
@Directions = isnull(Directions,''),
@Ingrediants = isnull(Ingrediants,''),
@Warnings = isnull(Warnings,''),
@ShortDescription = isnull(ShortDesc,''),
@LongDescription = isnull(LongDesc,''),
@NutritionFacts = isnull(NutritionFacts,''),
@SearchKeywords = isnull(SearchKeywords,''),
@IsTaxable = case when isnull(IsTaxable,0)=0 then 'No' else 'Yes' End,
@CreatedBy = isnull((select LName + ',' + FName from mUser where UserID=InsertedBy),''),
@CreatedOn = InsertedOn,
@UpdatedBy = isnull((select LName + ',' + FName from mUser where UserID=UpdatedBy),''),
@UpdatedOn = UpdatedOn,
@Status = Convert(int,isnull(Status,0))
FROM
mProduct a
WHERE
ProductID = @ProductID
SELECT
ID as PricingDetailID,
isnull(PricingFromQnty,0) as PricingFromQnty,
isnull(PricingToQnty,0) as PricingToQnty,
isnull(RangePrice,0) as RangePrice,
Convert(int,isnull(Status,0))as Status
FROM
dProduct
WHERE
ProductID = @CategoryID
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
Regards,
Bhairav
View 4 Replies
ADVERTISEMENT
Jan 17, 2005
I have a stored procedure that works when executed in query analyzer. (It is also way too long to post here) When called from my application ado.net returns the error:
Invalid object name #idTable
If I run the proc in query analyzer using the same parameters (copied from quickwatch while debugging) there is no error.
While very complicated, this procedure runs quickly so timing out is not an issue.
Does anyone know why a proc would run in query analyzer and not in an asp.net/c# application?
Thank you.
View 4 Replies
View Related
Nov 2, 2007
I am having a difficult time figuring this one out. I have a stored procedure that as part of an ASP.Net app connects to a csv file through a mapped network drive and imports the data into a table in SQL Server. Here it is.
------------------------------------------------------------------------
CREATE PROCEDURE [dbo].[usp_ImportComp]
-- Add the parameters for the stored procedure here
@CSV as varchar(255)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
Begin Try
Begin Tran
Declare @sql as nvarchar(max)
Set @SQL = 'Insert into dlrComp ( SN,
CM,
PM,
MC,
Comp_Total,
XU,
GM,
From_Date,
To_Date)
Select [Serial Number],
CM,
PM,
MC,
[Comp Total],
XU,
GM,
[From Date],
[To Date]
FROM OPENROWSET(' + char(39) + 'MICROSOFT.JET.OLEDB.4.0' + char(39) + ',' + char(39) + 'Text;Database=S:' + char(39) + ',' + char(39) + 'SELECT * FROM ' + @csv + char(39) + ')'
--print @sql
Exec sp_executesql @stmt=@sql
Commit Tran
End Try
Begin Catch
Rollback Tran
--Do some logging and stuff here
End Catch
END
------------------------------------------------------------------------------------
If I am connected to SQL through SQL Management Studio while logged in on the server that is running SQL as DomainUser1 and execute
exec usp_ImportComp @CSV='Comp.csv'
It completes successfully
However if I open SSMS (while logged into Windows on my PC as DomainUser2) using runas to run it as DomainUser1 while logged into my PC and connect to SQL Server using WIndows Auth and run the same I get the following error message.
OLE DB provider "MICROSOFT.JET.OLEDB.4.0" for linked server "(null)" returned message "'S:' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.".
If I add
With Execute as 'DomainUser1' and modify the stored procedure I get the same error message above.
If I log onto the Server that is running SQL as DomainUser2 I can successfully run
exec usp_ImportComp @CSV='Comp.csv'
Both User1 and User2 have the same permissions to the Share and csv as does the Domain user under whose context SQL Server is running.
What am I doing wrong?
View 4 Replies
View Related
Jul 24, 2006
hello,everybody ,i use the AnalysisServicesExecuteDDLTask ,but it dap an error "DDL is not valid",i don't konw what is the problem and how to solve?thank you!
View 1 Replies
View Related
Sep 11, 2006
im doing a sum on a table and it either returns a number in decimal format or 'null' . The problem is when it returns null i want it to just make the text say '0.00'. So i did a test on the object that if it returns NULL just print '0.00' but if it is not null it tells me that there is a number there and i want to store that as a decimal and print it out. But i get an error for a type cast when im not it should not even be going to that part of the code. In the code below the first executescaler will return null so it should just go straight to the else. But it gives me the type cast error in the if that shouldnt be seen. The error and code are below. //Borrower NSF FEES
cmd.CommandText = "select sum(itemamount) from postmtdtls where loanid='" + LoanID + "' and Transactioncode = '310'";
object temp = cmd.ExecuteScalar();
if (temp != null)
{
decimal B_NSFFees = ((decimal)cmd.ExecuteScalar());
borrowerPayoff_NSFFees.Text = String.Format("{0:#,#.##}", B_NSFFees).ToString(); //Borrower NSF FEES
}
else
{
borrowerPayoff_NSFFees.Text = "0.00"; //borrowerPayoff_NSFFees.Text = "0.00";
} Server Error in '/WebSite5' Application. Specified cast is not valid. 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.InvalidCastException: Specified cast is not valid.Source Error: Line 774: if (temp != null)
Line 775: {
Line 776: decimal B_NSFFees = ((decimal)cmd.ExecuteScalar());
Line 777: borrowerPayoff_NSFFees.Text = String.Format("{0:#,#.##}", B_NSFFees).ToString(); //Borrower NSF FEES
Line 778: }Source File: c:ProgrammingFilesWebSite5InvestorPool.aspx.cs Line: 776 Stack Trace: [InvalidCastException: Specified cast is not valid.]
InvestorPool.GetLoanInfo(String LoanID) in c:ProgrammingFilesWebSite5InvestorPool.aspx.cs:776
InvestorPool.MortAccountText(Object sender, EventArgs e) in c:ProgrammingFilesWebSite5InvestorPool.aspx.cs:660
System.Web.UI.WebControls.TextBox.OnTextChanged(EventArgs e) +75
System.Web.UI.WebControls.TextBox.RaisePostDataChangedEvent() +124
System.Web.UI.WebControls.TextBox.System.Web.UI.IPostBackDataHandler.RaisePostDataChangedEvent() +7
System.Web.UI.Page.RaiseChangedEvents() +138
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4507
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
View 10 Replies
View Related
Feb 27, 2004
Hi,
I'm trying to install MSDE SP3 which I downloaded from MS at http://www.asp.net/msde/.
Following the instructions as best I can I unzipped the file into a Folder now called MSDE located on C: I then went to a command prompt and typed in the command given to start the install:
setup SAPWD=testsite SecurityMode=SQL
Hit enter and the installer started up and ran for a few secs and then came back with
The Instance named specified is invalid
There was no mention of including an instance name or the format for it.
Suggestions please?
Also, if I want to completly uninstall MSDE if I need to how would I do it?
Thanks,
Bob
View 1 Replies
View Related
Apr 7, 2006
Can't seem to find why I'm getting this error: Specified cast is not valid.
Ok, using a stored procedure for SQL Server 2000 and here is the main part of it:
SELECT id, rank, firstName, lastName, service, status, createdTime FROM accessRequest WHERE lastName LIKE @tLastName AND firstName LIKE @tFirstName
And the C# code behind from the class file:
SqlDataReader spResults;
conn.Open();
spResults = command.ExecuteReader();
while( spResults.Read() )
{
AccessRequestSearch request = new AccessRequestSearch( (int)spResults.GetInt32( 0 ), spResults.GetString( 2 ), spResults.GetString( 3 ), spResults.GetString( 1 ), spResults.GetString( 4 ), spResults.GetString( 5 ), Convert.ToDateTime(spResults.GetString( 6 )));
searchResults.Add( request ); // Add to Array List
}
spResults.Close();
The part in red is where I think it's happening because that is what I just added to the request. createdTime in the table is set as DateTime.
Can anyone see what I am missing here?
More info is available if needed.
Thanks,
Zath
View 1 Replies
View Related
Jun 17, 1999
Hello:
I am getting an error:
User id 12 is not a valid user in database Dest_db
While using Database object transfer.
Using mixed security on the source database.
copy data and replace existing data options are selected.
View 1 Replies
View Related
Nov 24, 2004
Is the following valid syntax? Thanks for your help!
IF (SELECT chargeID FROM inserted = 0) BEGIN
END
OR, should I be doing something like this:
DECLARE @thisChargeID as int
SET @thisChargeID = (SELECT chargeID FROM inserted)
IF (@thisChargeID = 0) BEGIN
END
View 14 Replies
View Related
Jan 11, 2006
I have a question regarding the backup to use in case of consistency errors.
I'm backing up my dbs daily and logs hourly with 'verify the integrity of the backup when completed' checked. Today I found out one of my tables has 1 page id error (dbcc checkdb message from yesterday), I'm wondering if I can use yesterday's full backup even if it's done after the dbcc, that way I don't have to apply a lot less log backups. In other words, does or does not the full backup inherit the corruption if it is done after consistency errors and the backup passes the integrity verification.
Thanks,
Markham
View 11 Replies
View Related
Jul 20, 2005
Version 1:--------------------------------If Condition = AUPDATE query 1UPDATE query 2ELSE IF Condition = BUPDATE queryVersion 2:--------------------------------If Condition = ABEGINUPDATE query 1UPDATE query 2ENDELSE IF Condition = BBEGINUPDATE queryENDOr are they functionally equivalent?Thanks
View 2 Replies
View Related
Dec 22, 2006
Hi guys,
I'm having this really strange issue with mirroring.
I've followed the instructions on http://msdn2.microsoft.com/en-us/library/ms191140.aspx to the letter, leaving out the witness server part, as I don't have one.
All works OK, but when activating the mirroring on the principal server I get the usual error 1418 error. I fired up SQL Server Profiler to see what was happening, and the following error emerged.
Connection handshake failed. The certificate used by the peer is invalid due to the following reason: Certificate not yet valid. State 104.
Anyone have any ideas?
View 3 Replies
View Related
May 4, 2007
Hi,
I do not know what I did wrong. I tested a simple function in my custom code and get the error saying "Character is not valid". Any help is appreciated!
Here is the function inside my custom code.
Shared Function test() As string
Dim items As Fields
Return items("DataField1").Value;
End Function
I call the function in the body of my report using: Code.test()
and the error says "There is an error on line 18 of custom code: [BC30037] Character is not valid."
Thanks,
Tabbey
View 6 Replies
View Related
Dec 1, 2006
I get this error in a package which was executing previously. This is in SQLServer OLEDB DATASOURCE
Error at Membership_Other_Payer [DTS.Pipeline]: The index is not valid.
ADDITIONAL INFORMATION:
Exception from HRESULT: 0xC0048004 (Microsoft.SqlServer.DTSPipelineWrap)
This error occurs when I try to open my existing Oledb datasource. I have added some columns in my database
Any body has solution for this?
View 18 Replies
View Related
Jul 11, 2006
sqlConnection1.Open();
System.Data.SqlClient.SqlDataReader Dil1;
Dil1 = sqlDilGetir.ExecuteReader();
ddlDil1.Items.Add(new ListItem("1. Dil", ""));
while (Dil1.Read())
{
ddlDil1.Items.Add(new ListItem(Dil1.GetString(1), Dil1.GetString(0)));
}
Dil1.Close();
sqlConnection1.Close();
View 7 Replies
View Related
Apr 12, 2007
I've build a website with asp.net and on my local machine it run very we. but when I store my website on a server, I have a error : ...error: 25 - Connection String not valid...
This is my connection string on my local machine : "add name="csIyp" connectionString="data source=.SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|iyapason.mdf;User Instance=true" providerName="System.Data.SqlClient" "
And the connection string on my webserver : "add name="csIyp" connectionString="data source= .MSSQLSERVER;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|iyapason.mdf;User Instance=true" providerName="System.Data.SqlClient" "
So, what can I do to solve this probleme.
Thanks !
View 3 Replies
View Related
Aug 11, 2007
GO
CREATE TABLE [dbo].[CmnLanguage]( [Id] [char](2) NOT NULL CONSTRAINT PkCmnLanguage_Id PRIMARY KEY, [UniqueName] [varchar](26) NOT NULL, [NativeName] [nvarchar](26) NOT NULL, [DirectionType] [smallint] NOT NULL, [IsVisible] [bit] NOT NULL, [CreatedDateTime] [datetime] NOT NULL DEFAULT GETDATE(), [ModifiedDateTime] [datetime] NULL)
GO
CREATE TABLE [dbo].[CmnLink]( [Id] [int] IDENTITY(1,1) NOT NULL CONSTRAINT PkCmnLink_Id PRIMARY KEY, [UniqueName] [varchar](52) NOT NULL, [IsVisible] [bit] NOT NULL, [CreatedDateTime] [datetime] NOT NULL DEFAULT GETDATE(), [ModifiedDateTime] [datetime] NULL)
GO
CREATE TABLE [dbo].[CmnLinkCmnLanguage]( [LinkId] [int] NOT NULL CONSTRAINT FkCmnLinkCmnLanguage_LinkId FOREIGN KEY (LinkId) REFERENCES CmnLink(Id) ON DELETE CASCADE, [LanguageId] [char](2) NOT NULL CONSTRAINT FkCmnLinkCmnLanguage_LanguageId FOREIGN KEY (LanguageId) REFERENCES CmnLanguage(Id) ON UPDATE CASCADE ON DELETE CASCADE, [CreatedDateTime] [datetime] NOT NULL DEFAULT GETDATE(), [ModifiedDateTime] [datetime] NULL)
View 4 Replies
View Related
Nov 17, 2005
Here's my code: Dim Cmd as New SQLCommand(sqlString, conn) cmd.CommandType=CommandType.StoredProcedure Breaks Here ----->>cmd.parameters.add(New SQLParameter(@OrdAlias, OrdNum)) cmd.parameters.add(New SQLParameter(@AliasSourceCode, 4))The error says:compilation error - - then, on the line that is in red:Compiler Error Message: BC30037: Character is not valid.I have 'OrdNum' declared globally, and OrdNum is assigned right away in the Page_Load event. I've checked the spelling of the SQL parameters (OrdAlias is a varchar, and AliasSourceCode is a tinyInt)After all this - then, this code runsAny ideas why I'm getting this error??
View 1 Replies
View Related
Dec 16, 1999
all schedulled task on server failed for 18450 Process Exit Code 1. ...t Utility, Version 6.50.240 Copyright (C) Microsoft Corporation, 1995 - 1996 [Microsoft SQL-DMO] Error 18450: [SQL Server] Login failed- User: sqlexec Reason: Not defined as a valid user of a trusted SQL Server connection.
Any information on how to solve it
View 1 Replies
View Related
Nov 30, 2006
Code:
objrs.Open "Select * from [klcc_f$]", objConn, adOpenStatic
why IM getting dollar sign is not a valid name ?
View 2 Replies
View Related
Feb 7, 2008
I wonder about whether this rule is valid or invalid for nested BEGIN/END statement...
Code:
BEGIN
BEGIN
--Query #1 (blah)...
END
WHILE EXISTS (SELECT TOP 1 * FROM #tmpTblPurchaseRaw)
BEGIN
BEGIN
--Query #2 (blah)...
END
BEGIN
--Query #3 (blah)...
END
END
END
I have no idea if nested BEGIN/END is allowed or not...
View 1 Replies
View Related
Mar 17, 2004
I've got a linked server setup to DB2, and some of the
date fields in the DB contain 1/1/0001 values.
I've got views created in SQL2000 against the DB2 linked server.
When I run a query against a particular table that contains multiple field of datetime type.
I get the below error
Server: Msg 8114, Level 16, State 8, Line 1
Error converting data type DBTYPE_DBTIMESTAMP to datetime.
This only happens when I include in the select the field that contains 1/1/0001 values.
I assume since valid dates ranges in SQL are from
January 1, 1753 through December 31, 9999, this would be
what's causing this.
I tried to covert in the select but that failed as well. The only thing that I've been able to do, is to use a DTS to pull the data from the DB2 to a local SQL2000 table, with that fields type set as varchar. This works.
Using a DTS to pull the data to a local table in production isn't a viable workaround, since this table contains 1.8 million rows.
How is DTS converting this field, when convert fails in the select?
How do I get around this?
Thanks
View 13 Replies
View Related
Jan 28, 2008
Hi folks
I've just set up a maintenance plan that backs up all user databases daily and logs hourly. I've just noticed that the plan history is giving the following error -
Database 'BizTalkEDIDb' is not valid to be included in the maintenance plan.
Has anyone seen this before or know how to resolve it?
James
View 8 Replies
View Related
Nov 13, 2006
New to SQL Server installations. I downloaded the SQL Server Express with Advanced; when I double click the Setup.exe, I get a pop-up "document path/file is not a valid Win32 application". I upgraded from XP Home to XP Pro SP2.0. Any suggestions?
View 1 Replies
View Related
Feb 12, 2008
Hello Everybody
I'm getting a strange error.
I have created a Datatable and in this table I have multiple Columns.
I have given them all a name and now when I want to put data in the DataTable I get a error.
All goes well until I try to Update the Datatable
Code Snippet
DataRow DrWb = ppcDbDataSet.Item.NewRow();
DrWerkbon["ItemNummer"] = Defines.mcItem.miItemNr;
DrWerkbon["WorkerNummer"] = Defines.mcWorker.msWorkerNr;
Defines.mcItem.msWorkerNr = Defines.mcWorker.msWorkerNr;
DrWerkbon["CustomNummer"] = Defines.mcCustom.msCustomNr;
Defines.mcItem.msCustomNr = Defines.mcCustom.msCustomNr;
DrWerkbon["WbRedenBezoek"] = edRedenBezoek.Text;
Defines.mcItem.msReason = DrWb["WbReason"].ToString();
ppcDbDataSet.Item.Rows.Add(DrWerkbon);
ItemTableAdapter.Update(DrWb);
ppsDbDataSet.Clear();
ItemTableAdapter.Fill(ppcDbDataSet.Item);
At the ItemTableAdapter.Update(DrWb) it gives the error:
SqlCeException was unhandled
The Column name is not valid. [ Node name (if any) = , Column name = WbReason ]
I don't understand why it is giving this error because the name of the column realy is WbReason
Does anybody know what to do about this??
Kind regards
Korsten
View 3 Replies
View Related
Oct 4, 2007
Hi,
I'm trying to set up a data-driven subscription and having problems with parameters. On the Report Parameter Values screen of the Create Data-Driven Subscription function I have set a parameter TimesheetPeriodEnd to "Specify a static value" and checked the NULL box. In the report the parameter is type string and allows nulls. When I try to run the subscription the reports are not sent and the error log contains the following message:
ReportingServicesService!library!f!10/05/2007-09:31:08:: Status: Failure sending mail: Default value or value provided for the report parameter 'TimesheetPeriodEnd' is not a valid value.
ReportingServicesService!notification!f!10/05/2007-09:31:08:: Notification 0ae544df-4b1b-4a46-b7ab-cdefdca201be completed. Success: False, Status: Failure sending mail: Default value or value provided for the report parameter 'TimesheetPeriodEnd' is not a valid value., DeliveryExtension: Report Server Email, Report: Timesheet, Attempt 0
I am also setting other parameters for this subscription in the same way and not getting errors.
Any ideas? Previously I have had problems passing null values to parameters from the subscription query "Get value from database" from SELECT NULL AS ParameterName (this function just doesn't seem to work in SSRS). But I'm surprised I can't even seem to get this working with the default settings.
Regards,
Greg
View 5 Replies
View Related
Jan 17, 2006
I pass in a variable SourceServer to my package via the command line. In our production environment we are seeing:
The expression "@[User::SourceServer]" on property "ServerName" cannot be evaluated. Modify the expression to be valid
Is this just because the evaluation takes place prior to the command line parameters being set and I need to turn off validation?
Thanks,
Chris
View 2 Replies
View Related
Sep 26, 2007
I am deploying an rdl that is being deployed in a server.But i am encountering a problem regarding the valid values of the parameter.My parameters have dependencies,and one of my parameter comes out with two dependencies.
Scenario :
User needs to input his userID to access Book A.
Book B needs Book A because the output will be depending on the its content.
And Book C depend on Book B.
Problem:
when deploying, only Book A will have the initial value.The dependency in Book B is only one,which is fine.It shows its valid values. But how about for Book C which have 2 dependencies? Because it doesnt show it's valid values..
View 3 Replies
View Related
Jan 28, 2008
The configuration file name "C:......XMLSSIS2005_ConStr.dtsConfig" is not valid. Check the configuration file name.
The path is correct but we got this error. Please help us.
View 1 Replies
View Related
Jun 12, 2015
when installing sql server error showing file format is not vaild
View 3 Replies
View Related
May 3, 2006
I have just downloaded the MS SQL Server Management Studio Express, and are following a tutorial on www.learnvisualstudio.net
Now I am having trouble with some owner information. The message says :
"Database diagram support objects cannot be installed because this database does not have a valid owner. To continue, first use the Files page of the Database Properties dialog box or the ALTER AUTORIZATION statement to set the database owner to a valid login, then add the database diagram support objects"
I should mention that my WIN XP username is "Bjørn" with the Norwegian letter "Ø" in the middle. I suspect it to have a problem with that letter?
Any better suggestions?
View 5 Replies
View Related
May 28, 2007
Hi there guys!!
I am having an issue with generating a table for an report on the fly. I have been referring to the example on www.gotreportviewer.com and their example works fine but when i attempt to do my own version (by adding the table, I get the following error:
The report definition is not valid. Details: The element 'TableColumns' in namespace 'http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition' has incomplete content.
List of possible elements expected: 'http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition:TableColumn'.
From my understanding 'TableColumns' was not expected even though i reference it correctly in my code and I it is defined in the ReportDefinition. It also causes no problems for the example from the above website.
Can anyone help with this problem?
Thanks a million!
View 3 Replies
View Related
Jul 25, 2006
I have been having a problem trying to connect to a SQL Server. I have installed the Developer edition on an MS Small Business edition 2003 server
I also installed MS Sql Manager and I was able to create a database and connect to it. The database server is in the same PC. I used the surface configuration to enable remote connections using TCP /IP and pipe lines.
My application runs without a problem on my development machine but when I deployed on this server I get the provider: SQL Network Interfaces, error: 25 - Connection string is not valid Error.
this is my config file setup
<connectionStrings> <add name="Diamond_dbConnectionString" connectionString="Data Source=192.168.1.104MSSQLSERVER;Initial Catalog=Diamond_db;Integrated Security=True" providerName="System.Data.SqlClient" /> </connectionStrings>
I have google and yahoo this error I found a lot of information I've tried many of them but still having the problem. I will appreciate your help solving this problem. I have a customer waiting since last week to see this site and I'm still stuck.
Tia
Charles
PS. Below I pasted the complete error info I get.
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: 25 - Connection string is not valid) 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: 25 - Connection string is not valid)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: 25 - Connection string is not valid)]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +734995
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) +359
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.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +121
System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) +162
System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) +107
DiamondTableAdapters.COUNTRIES_TEMPLATETableAdapter.GetContriesTemplate() +108
[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.Web.UI.WebControls.ObjectDataSourceView.InvokeMethod(ObjectDataSourceMethod method, Boolean disposeInstance, Object& instance) +482
System.Web.UI.WebControls.ObjectDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +2040
System.Web.UI.WebControls.BaseDataList.GetData() +53
System.Web.UI.WebControls.DataList.CreateControlHierarchy(Boolean useDataSource) +284
System.Web.UI.WebControls.BaseDataList.OnDataBinding(EventArgs e) +56
System.Web.UI.WebControls.BaseDataList.DataBind() +72
System.Web.UI.WebControls.BaseDataList.EnsureDataBound() +55
System.Web.UI.WebControls.BaseDataList.CreateChildControls() +63
System.Web.UI.Control.EnsureChildControls() +87
System.Web.UI.Control.PreRenderRecursiveInternal() +41
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
View 6 Replies
View Related