Showing posts with label cant. Show all posts
Showing posts with label cant. Show all posts

Tuesday, March 27, 2012

Error: can't load configuration file

I had VS 2005 RC installed along with the Sep CTP of SQL Server (tools only)
and it was working fine.
Then I installed VS 2003 on that same machine. Now, everytime I lauch VS
2005 I get this message:
The configuration file RSReportDesigner.config could not be loaded.
The type initializer for "Microsoft.ReportingServices.Library.Global"
threw an exception.
I don't even use reporting services. Does anyone know how to make this
error go away?
TIA,
Mike RodriguezMichael Rodriguez wrote:
> I had VS 2005 RC installed along with the Sep CTP of SQL Server (tools only)
> and it was working fine.
> Then I installed VS 2003 on that same machine. Now, everytime I lauch VS
> 2005 I get this message:
> The configuration file RSReportDesigner.config could not be loaded.
> The type initializer for "Microsoft.ReportingServices.Library.Global"
> threw an exception.
> I don't even use reporting services. Does anyone know how to make this
> error go away?
> TIA,
> Mike Rodriguez
I was using Reporting Services just fine until I've installed VS.net
2003, now I get the same error message you're getting...Can anybody
help?sql

Error: Cannot fetch the rowset from OLE DB provider "SQLNCLI" for linked server "

Hi,

I′m trying to make several distributed queries to a linked server, and for some of them I get this error message. I can′t find anytihing about it anywhere. Can anyone tell me what could be the reason of this error? The way I'm executing the query in my stored procedure is:

exec sp_executesql @.sqlinsert

@.sqlinsert being a nvarchar sentence that contains the distibuted query.

Thank you!

Mehdi

Guess the provider needs a return value. I don′t know if it needs a return status like return 1 or return 0, or he needs something to handle (just a dummy select or something else. Try setting the return value for the stored procedure.

HTH, Jens Suessmeyer.

Thursday, March 22, 2012

error: 40 with sql server 2000

Hi

I am getting this really annoying error that I cant resolve.

I have created a website that accesses a SQL SERVER 2000 database and it works perfectly on my home machine. The error has occurred when I have transferred it to my hosts server.

This is the 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)

This is my connection string:

<add key="ConnectionString" value="Provider=sqloledb;Data Source=hostsserver****,1433;Initial

Catalog=db******;User Id=dbo*******;Password=********; "/>

It says I am trying to connect to a SQL SERVER 2000 database as this is what I devloped the site on so I don not know why it thinks I am trying to connect to SQL SERVER 2005.

Can anyone help?

Moving to the Data Access forum.|||

Is this constant or intermittent error?

1) Make sure no typo on the data source (server name)
2) Hostsserver,1433, implys it will use TCP, so make sure TCP is enabled on the sql server. Keep in mind firewall can block the traffic, so put 1433 into exception.

Did you install SQL server 2005 and/or SNAC on your client machine? Client stack does not know whether the target sql server is 2000 or 2005. 2005 is always reported, You can ignore it.

Thanks.

|||

Hi
Thanks for replying.
I have double checked the datasource and that seems right.

How can I check if the host server is TCP enabled?

I have never installed/used 2005 so dont know why.

any help would be really appreciated.

|||On you server machine, Start->All Programs->Microsoft SQL Server -->SQL Server Server Utility. Add TCP to your enabled protocols and restart sql server.sql

Sunday, March 11, 2012

ERROR: "activex component can't create object: 'excel.application'"

When I run a DTS, I get the following error.
Error I get: "activex component can't create object:
'excel.application'"
I was told not to load excel into sql server. Well, in any case, there
should not be any need to load excel, it recognizes the excel component
in the DTS, that means, it should be recognizing excel.
Please assist.
Thx,
Swim.
'***************************************
*******************************
' Visual Basic Transformation Script
'***************************************
*********************************
Function Main()
' Initialise dimensions
Dim appExcel
Dim newBook
Dim oSheet
Dim oPackage
Dim oConn
'Set excel objects
Set appExcel = CreateObject("Excel.Application")
Set newBook = appExcel.Workbooks.Add
Set oSheet = newBook.Worksheets(1)
' Populate heading columns for mapping purposes and display in excel
oSheet.Range("A1").Value = "Col1"
oSheet.Range("B1").Value = "Col2"
oSheet.Range("C1").Value = "Col3"
oSheet.Range("D1").Value = "Col4"
'Dynamically specify the name of the new Excel file to be created and
exported to
DTSGlobalVariables("fileName").Value = "C:\Rpts\cc\a.xls"
'" & DTSGlobalVariables("gvID").value & ".xls"
With newBook
.SaveAs DTSGlobalVariables("fileName").Value
.save
End With
appExcel.quit
set oPackage = DTSGlobalVariables.parent
'connection 2 is to the Excel file
set oConn = oPackage.connections(2)
oConn.datasource = DTSGlobalVariables("fileName").Value
'Destroy objects
set oPackage = nothing
set oConn = nothing
Main = DTSTaskExecResult_Success 'End on success
End FunctionIs your DTS package just exporting to or import from Excel or is it
instantiating Excel from a VBScript task?
"Swim" <crombusch@.gmail.com> wrote in message
news:1134093275.263026.230460@.g44g2000cwa.googlegroups.com...
> When I run a DTS, I get the following error.
> Error I get: "activex component can't create object:
> 'excel.application'"
> I was told not to load excel into sql server. Well, in any case, there
> should not be any need to load excel, it recognizes the excel component
> in the DTS, that means, it should be recognizing excel.
> Please assist.
> Thx,
> Swim.
>
>
>
>
> '***************************************
*******************************
> ' Visual Basic Transformation Script
> '***************************************
*********************************
> Function Main()
> ' Initialise dimensions
> Dim appExcel
> Dim newBook
> Dim oSheet
> Dim oPackage
> Dim oConn
> 'Set excel objects
> Set appExcel = CreateObject("Excel.Application")
> Set newBook = appExcel.Workbooks.Add
> Set oSheet = newBook.Worksheets(1)
> ' Populate heading columns for mapping purposes and display in excel
> oSheet.Range("A1").Value = "Col1"
> oSheet.Range("B1").Value = "Col2"
> oSheet.Range("C1").Value = "Col3"
> oSheet.Range("D1").Value = "Col4"
>
> 'Dynamically specify the name of the new Excel file to be created and
> exported to
> DTSGlobalVariables("fileName").Value = "C:\Rpts\cc\a.xls"
> '" & DTSGlobalVariables("gvID").value & ".xls"
> With newBook
> .SaveAs DTSGlobalVariables("fileName").Value
> .save
> End With
> appExcel.quit
> set oPackage = DTSGlobalVariables.parent
> 'connection 2 is to the Excel file
> set oConn = oPackage.connections(2)
> oConn.datasource = DTSGlobalVariables("fileName").Value
> 'Destroy objects
> set oPackage = nothing
> set oConn = nothing
> Main = DTSTaskExecResult_Success 'End on success
> End Function
>

Friday, March 9, 2012

Error. My aspx file cant access server to connect to database

Hi,

I am writing my first aspx file to connect to a standalone SQL Server which is separated from the IIS webserver. The code is

<HTML>
<HEAD>
<TITLE>Store Locator</TITLE>
<script runat="server">
Sub Page_Load(ByVal Sender as Object, ByVal E as EventArgs)
if Not IsPostBack Then
Dim DBConn as OleDbConnection
Dim DBCommand As OleDbDataAdapter
Dim DSPageData as New DataSet
DBConn = New OleDbConnection("Provider=sqloledb;" _
& "server=dailyplanet;" _
& "Initial Catalog=JAVSTORE;" _
& "User Id=javtrader;" _
& "Password=rage123;")
DBCommand = New OleDbDataAdapter _
("Select * " _
& "From JAVInventory " _
& "Where ID > ((Select COUNT(ID) " _
& "From JAVInventory ) - 100)" _
& "Order By ID DESC", DBConn)
DBCommand.Fill(DSPageData, _
"RecentJAVs")
' ddlZipCode.DataSource = _
' DSPageData.Tables("RecentJAVs").DefaultView
' ddlZipCode.DataBind()
End If
End Sub

I used Visual .Net and Web Matrix and was able to connect to the sql server with the Data Connection to view the tables. However, when I use IIS or the Visual .Net debugger to run the aspx file, it get the following error.. please help..

Server Error in '/javtrade' Application.
------------------------

[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.
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.OleDb.OleDbException: [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.

Source Error:

Line 21: & "From JAVInventory ) - 100)" _
Line 22: & "Order By ID DESC", DBConn)
Line 23: DBCommand.Fill(DSPageData, _
Line 24: "RecentJAVs")
Line 25: ' ddlZipCode.DataSource = _

Source File: c:\inetpub\wwwroot\javtrade\management.aspx Line: 23

Stack Trace:

[OleDbException (0x80004005): [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.]
System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr)
System.Data.OleDb.OleDbConnection.InitializeProvider()
System.Data.OleDb.OleDbConnection.Open()
System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState) +44
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +304
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +77
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +36
ASP.management_aspx.Page_Load(Object Sender, EventArgs E) in c:\inetpub\wwwroot\javtrade\management.aspx:23
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731FYI, when using sql server it is better to use the sql namespace over the oledb. I assume you have a connection string in your web.config file. This can be formed in two ways, one using a trusted connection, or the other being uid=; and pwd=; the login and password for sql respectively. Either version of the connection string must include the server name, which is localhost, 127.0.0.1 if on the localmachine or the actual name or ip of the server.

Sunday, February 26, 2012

error with c# select statement

hi i have copied this from my other page where it works fine and i cant understand what is going wrong! maybe one of your guys can point out what i cant see! herei s my code

string strOrderID = Request.QueryString["orderID"].ToString();

int intOrderID =Convert.ToInt32(strOrderID);

int intCustID =Convert.ToInt32(Request.QueryString["qsnOrderCustID"].ToString());

lblCustomerID.Text = Request.QueryString["qsnOrderCustID"].ToString();lblOrderID.Text = Request.QueryString["orderID"].ToString();

SqlConnection myConn =newSqlConnection("Data Source=xxxx;Initial Catalog=xxxx;User ID=xxxx;Password=xxxx");

//This is the sql statement.

string sql ="SELECT [del_address], [del_post_code], [del_time] From tbl_del WHERE order_ID = " + intOrderID;

//This creates a sql command which executes the sql statement.

SqlCommand sqlCmd =newSqlCommand(sql, myConn);

myConn.Open();

SqlDataReader dr = sqlCmd.ExecuteReader();

//This reads the first result from the sqlReader

dr.Read();

try

{

lblDelTime.Text =Convert.ToString(dr["del_time"].ToString);

lblDelAddy.Text = dr["del_address"].ToString();

lblDelPCode.Text = dr["del_post_code"].ToString();if (lblDelAddy.Text !="")

{

lblDelDate.Visible =true;

lblDelTime.Visible =true;

Label1.Visible =true;

Label2.Visible =true;

}

}

catch (Exception except)

{

lblerror.Text =Convert.ToString(except);

}

Regards

Jez

What error are you getting?

|||

try

{

lblDelTime.Text =Convert.ToString(dr["del_time"].ToString);

lblDelAddy.Text = dr["del_address"].ToString();

lblDelPCode.Text = dr["del_post_code"].ToString();if (lblDelAddy.Text !="")

{

lblDelDate.Visible =true;

lblDelTime.Visible =true;

Label1.Visible =true;Label2.Visible =true;

}

}

catch (Exception except)

{

lblerror.Text =Convert.ToString(except);

}

I can only find the above problem in the code...if you can name the error it will be more helpful for us.

|||

i realised that i was being a complete idiot (thats what being up for to long does! makes you miss the obvious!) i took a look at the bigger picture, it said that the textbox wasnt being filled, so maybe a problem with the data reader, no, but because i have 2 data readers on one page and i just copied and pasted the code, i forgot to put dr2[" instead of dr["

Friday, February 24, 2012

Error while using first time!

I'm trying to learn about SQL databases and use them for my asp.net app sine I cant get the hang of MySQL in ASP. Every time I go to create a new SQL Database it saids: Would you like to place it in the App_Data folder basicly and I say yes. Then the error:

Unable to find DbProivderFactory for type System.Data.SqlClient.SqlConnection

Hi Clanstyles,

Based on the error message, I think the provider factory was not installed properly on you machine. Or the configuration files might not be written correctly.

Please try the following:

1. Open machine.config file under C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG
2. Check the nodes under configuration/system.data/DbProviderFactories to see if all the provider has been installed successfully. It has to look like this.

<DbProviderFactories>
<add name="Odbc Data Provider" invariant="System.Data.Odbc" description=".Net Framework Data Provider for Odbc" type="System.Data.Odbc.OdbcFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add name="OleDb Data Provider" invariant="System.Data.OleDb" description=".Net Framework Data Provider for OleDb" type="System.Data.OleDb.OleDbFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add name="OracleClient Data Provider" invariant="System.Data.OracleClient" description=".Net Framework Data Provider for Oracle" type="System.Data.OracleClient.OracleClientFactory, System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add name="SqlClient Data Provider" invariant="System.Data.SqlClient" description=".Net Framework Data Provider for SqlServer" type="System.Data.SqlClient.SqlClientFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</DbProviderFactories>

HTH.