Showing posts with label connection. Show all posts
Showing posts with label connection. Show all posts

Thursday, March 29, 2012

cant connect

i am devleoping an ASP.Net website now. i got a problem on connecting. when i try to connect (i manually made thew connection), it wont connect. the error is this:

System.Data.SqlClient.SqlException: Cannot open user default database. Login failed.
Login failed for user 'MANEC\Batman'.
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)

I have other other webpage that uses sqlconenction. they connect fine but they are not manually created. i created their connection through the sqldatasource wizard. i am testing these pages using the built-in server of VWD-Express but when you test it on IIS it gets an error (this is my 2nd problem). i am totally confused.

i am thinking there is something missing in the connection that i manually created. I put the settings in the "web.config" file but it did no good.

can you give me instruction on how to properly connect from Web? PLS? i have no problem connecting when i am creating desktop applications (using C# & SQLExpress).

PLS HELP. pls.

Seems that the user has an orphaned database assigned to, try to set the deault database of the user to a valid one.

sp_defaultdb

Changes the default database for a Microsoft SQL Server login.

More information in the BOL.


HTH; jens Suessmeyer.

|||

thanks for the reply. i have solved this issue by setting sql authentication to mixed mode and assigned a username/password on the connection string. it connects now.

i can see that the connection is ok but when i am attemting to create a new table to the ASPNETDB.mdf, i get this error message:

System.Data.SqlClient.SqlException: Unable to open the physical file "D:\myDocs\Visual Studio 2005\WebSites\techPad\App_Data\ASPNETDB.MDF". Operating system error 32: "32(The process cannot access the file because it is being used by another process.)".
Unable to open the physical file "D:\myDocs\Visual Studio 2005\WebSites\techPad\App_Data\ASPNETDB_log.ldf". Operating system error 32: "32(The process cannot access the file because it is being used by another process.)".
Cannot open user default database. Login failed.
Login failed for user 'xxx'.
File activation failure. The physical file name "D:\myDocs\Visual Studio 2005\WebSites\techPad\App_Data\ASPNETDB_log.ldf" may be incorrect.at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)

PLS HELP.

|||OK, strange thing. Seems that you connected with the attachdbfile option a database, but connect with another connection to the sql server express attached database or vice versa. But you have to decide wheter you want to use the service of the direct attachdbfile way.

HTH, jens Suessmeyer.|||

Jens Suessmeyer wrote:

OK, strange thing. Seems that you connected with the attachdbfile option a database, but connect with another connection to the sql server express attached database or vice versa. But you have to decide wheter you want to use the service of the direct attachdbfile way.

HTH, jens Suessmeyer.

you are right. i attached ASPNETDB.net using attachdbfile. that is set on the web.config file.

|||

somehow i have resolved this issue but the problem keeps on coming after another.

from the suggestion of the people from www.asp.net ( http://forums.asp.net/1/904462/ShowPost.aspx#904462 ) here is what i got now:

error after disabling "Write" capability from ACL:
System.Data.SqlClient.SqlException: Failed to update database "C:\INETPUB\WWWROOT\TECHPAD\APP_DATA\ASPNETDB.MDF" because the database is read-only. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)

error after ENABLING "Write" capability from ACL:
System.Data.SqlClient.SqlException: Cannot open user default database. Login failed. Login failed for user 'MANEC\ASPNET'. at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)

this makes me think its so hard to study VWD and SQLExpress for a newbie like me. when I run the webpages from the built-in webserver of VWD it may work fine but when on IIS it will not work (or vice-versa). so confusing. maybe bcoz im very new to this.

i find it hard to do all of these setups. i wanna learn this though. PLS HELP.

|||i posted the same issue to the other page here. pls help. pls check this out > http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=68698&SiteID=1&PageID=1

can't conect remotely to SQL Express

I am connecting remotely to SQL Express using my VB application. Here is the
connection string that I use.
cn.ConnectionString = "Provider=SQLNCLI;Network Library=DBMSSOCN;Integrated
Security=SSPI;"Server=192.168.10.243\SQLEXPRESS,1433;" & _
"database=CopyRequest"
I get "Login failed for user 'ILYA-TEST-PC\Guest'" error when I try to
connect. What is the cause of this error? I allow remote connections on SQL
Server.Hi
Have you checked the permissions for 'ILYA-TEST-PC\Guest' ?
John
"Ilya" wrote:
> I am connecting remotely to SQL Express using my VB application. Here is the
> connection string that I use.
> cn.ConnectionString = "Provider=SQLNCLI;Network Library=DBMSSOCN;Integrated
> Security=SSPI;"Server=192.168.10.243\SQLEXPRESS,1433;" & _
> "database=CopyRequest"
> I get "Login failed for user 'ILYA-TEST-PC\Guest'" error when I try to
> connect. What is the cause of this error? I allow remote connections on SQL
> Server.|||Guest is disabled by default. I assume you're not logged in as guest when
you try to make the connection so this error means you are connecting as a
Windows user who doesn't have permissions or can't be authenticated to the
local Windows machine. Get Windows security working and I think it will
work.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Ilya" <Ilya@.discussions.microsoft.com> wrote in message
news:6CAFF2A5-3273-4E28-AFEB-07060DFFE503@.microsoft.com...
>I am connecting remotely to SQL Express using my VB application. Here is
>the
> connection string that I use.
> cn.ConnectionString = "Provider=SQLNCLI;Network
> Library=DBMSSOCN;Integrated
> Security=SSPI;"Server=192.168.10.243\SQLEXPRESS,1433;" & _
> "database=CopyRequest"
> I get "Login failed for user 'ILYA-TEST-PC\Guest'" error when I try to
> connect. What is the cause of this error? I allow remote connections on
> SQL
> Server.

Sunday, March 25, 2012

Can't assign connection manager object to DataReader Source

I'm trying to create a DataReader source object using a working ADO.NET Oracle Client connection object that exists in the connection manager.

Problem:

When I open the editor the DataReaderSrc component shows only one row under the Connection Managers tab:

Name=IDbConnection
Connection Manager=blank
Description=Managed connection manager

I cannot assign the ADO.NET connection (or any connections). I see a warning at the bottom of the Connection Managers tab:

"Not all connection managers have been set. Set all connection managers."

When I click refresh the warning message changes to:

"The runtime connection manager with the ID "" cannot be found. Verify that the connection manager collection has a connection manager with that ID."

I am prevented from removing the IDbConnection or assigning my Connection Manager object to the DataReader Source.

Thanks, -- Mike

I also have the same problem, I'm sure it must be some tiny detail somewhere / something very basic, but I have been unable to fix it. Can someone help? Thanks!

Hector

|||

I had the same problem because I was using the wrong Provider when specifying my Data Source.

Hope it helps,

Nuno

|||

I had the same problem. In my case the 'advanced editor for datareader source' is very, very confusing. First of all, you have to create a connection manager, which I did already. But, it was not at all intuitive that you have to click on the box under 'connection manager' and select a connection manager. By default the box is black and grayed out like both the other fields which you cannot change. Gee, thanks redmond.

|||Thanks for taking the time to post this answer. I finally learned this last week at a SQL Server training class. The instructor pointed out that you actually need to change the disabled looking box.|||

Hello.

I read that you found a solution, but I didn't understand it very well.

Could you tell me more how to resolve this problem. I have create the connection manager and a cant set it into the DataReader Source

Thank you.

|||

Data Reader source accepts connection manager of Type ADO.NET only.

so First you have to create a Connection Manager to your Data Base using ADO.net Provider ONLY.

open the advanced editior of data reader source, go to connection managers tab, you will see IdbConnection , beside that there will be another column named connection manger, select your created connection manager there (ADO.Net one). Then go to Component properties tab and in sql command enter your sql query. go to columns mapping tab ..now you can see your columns.

|||thank you for your reply. i resolve the problem.|||

hello,

i thought that I resolve the problem of the connection but there was another problem that didn't permit me to save the connection to the advanced editor.

the error is "Component is already connected. The component needs to be disconnected before attempting to connect it."

Can you help me?

Can't assign connection manager object to DataReader Source

I'm trying to create a DataReader source object using a working ADO.NET Oracle Client connection object that exists in the connection manager.

Problem:

When I open the editor the DataReaderSrc component shows only one row under the Connection Managers tab:

Name=IDbConnection
Connection Manager=blank
Description=Managed connection manager

I cannot assign the ADO.NET connection (or any connections). I see a warning at the bottom of the Connection Managers tab:

"Not all connection managers have been set. Set all connection managers."

When I click refresh the warning message changes to:

"The runtime connection manager with the ID "" cannot be found. Verify that the connection manager collection has a connection manager with that ID."

I am prevented from removing the IDbConnection or assigning my Connection Manager object to the DataReader Source.

Thanks, -- Mike

I also have the same problem, I'm sure it must be some tiny detail somewhere / something very basic, but I have been unable to fix it. Can someone help? Thanks!

Hector

|||

I had the same problem because I was using the wrong Provider when specifying my Data Source.

Hope it helps,

Nuno

|||

I had the same problem. In my case the 'advanced editor for datareader source' is very, very confusing. First of all, you have to create a connection manager, which I did already. But, it was not at all intuitive that you have to click on the box under 'connection manager' and select a connection manager. By default the box is black and grayed out like both the other fields which you cannot change. Gee, thanks redmond.

|||Thanks for taking the time to post this answer. I finally learned this last week at a SQL Server training class. The instructor pointed out that you actually need to change the disabled looking box.|||

Hello.

I read that you found a solution, but I didn't understand it very well.

Could you tell me more how to resolve this problem. I have create the connection manager and a cant set it into the DataReader Source

Thank you.

|||

Data Reader source accepts connection manager of Type ADO.NET only.

so First you have to create a Connection Manager to your Data Base using ADO.net Provider ONLY.

open the advanced editior of data reader source, go to connection managers tab, you will see IdbConnection , beside that there will be another column named connection manger, select your created connection manager there (ADO.Net one). Then go to Component properties tab and in sql command enter your sql query. go to columns mapping tab ..now you can see your columns.

|||thank you for your reply. i resolve the problem.|||

hello,

i thought that I resolve the problem of the connection but there was another problem that didn't permit me to save the connection to the advanced editor.

the error is "Component is already connected. The component needs to be disconnected before attempting to connect it."

Can you help me?

Can't assign connection manager object to DataReader Source

I'm trying to create a DataReader source object using a working ADO.NET Oracle Client connection object that exists in the connection manager.

Problem:

When I open the editor the DataReaderSrc component shows only one row under the Connection Managers tab:

Name=IDbConnection
Connection Manager=blank
Description=Managed connection manager

I cannot assign the ADO.NET connection (or any connections). I see a warning at the bottom of the Connection Managers tab:

"Not all connection managers have been set. Set all connection managers."

When I click refresh the warning message changes to:

"The runtime connection manager with the ID "" cannot be found. Verify that the connection manager collection has a connection manager with that ID."

I am prevented from removing the IDbConnection or assigning my Connection Manager object to the DataReader Source.

Thanks, -- Mike

I also have the same problem, I'm sure it must be some tiny detail somewhere / something very basic, but I have been unable to fix it. Can someone help? Thanks!

Hector

|||

I had the same problem because I was using the wrong Provider when specifying my Data Source.

Hope it helps,

Nuno

|||

I had the same problem. In my case the 'advanced editor for datareader source' is very, very confusing. First of all, you have to create a connection manager, which I did already. But, it was not at all intuitive that you have to click on the box under 'connection manager' and select a connection manager. By default the box is black and grayed out like both the other fields which you cannot change. Gee, thanks redmond.

|||Thanks for taking the time to post this answer. I finally learned this last week at a SQL Server training class. The instructor pointed out that you actually need to change the disabled looking box.|||

Hello.

I read that you found a solution, but I didn't understand it very well.

Could you tell me more how to resolve this problem. I have create the connection manager and a cant set it into the DataReader Source

Thank you.

|||

Data Reader source accepts connection manager of Type ADO.NET only.

so First you have to create a Connection Manager to your Data Base using ADO.net Provider ONLY.

open the advanced editior of data reader source, go to connection managers tab, you will see IdbConnection , beside that there will be another column named connection manger, select your created connection manager there (ADO.Net one). Then go to Component properties tab and in sql command enter your sql query. go to columns mapping tab ..now you can see your columns.

|||thank you for your reply. i resolve the problem.|||

hello,

i thought that I resolve the problem of the connection but there was another problem that didn't permit me to save the connection to the advanced editor.

the error is "Component is already connected. The component needs to be disconnected before attempting to connect it."

Can you help me?

Can't assign connection manager object to DataReader Source

I'm trying to create a DataReader source object using a working ADO.NET Oracle Client connection object that exists in the connection manager.

Problem:

When I open the editor the DataReaderSrc component shows only one row under the Connection Managers tab:

Name=IDbConnection
Connection Manager=blank
Description=Managed connection manager

I cannot assign the ADO.NET connection (or any connections). I see a warning at the bottom of the Connection Managers tab:

"Not all connection managers have been set. Set all connection managers."

When I click refresh the warning message changes to:

"The runtime connection manager with the ID "" cannot be found. Verify that the connection manager collection has a connection manager with that ID."

I am prevented from removing the IDbConnection or assigning my Connection Manager object to the DataReader Source.

Thanks, -- Mike

I also have the same problem, I'm sure it must be some tiny detail somewhere / something very basic, but I have been unable to fix it. Can someone help? Thanks!

Hector

|||

I had the same problem because I was using the wrong Provider when specifying my Data Source.

Hope it helps,

Nuno

|||

I had the same problem. In my case the 'advanced editor for datareader source' is very, very confusing. First of all, you have to create a connection manager, which I did already. But, it was not at all intuitive that you have to click on the box under 'connection manager' and select a connection manager. By default the box is black and grayed out like both the other fields which you cannot change. Gee, thanks redmond.

|||Thanks for taking the time to post this answer. I finally learned this last week at a SQL Server training class. The instructor pointed out that you actually need to change the disabled looking box.|||

Hello.

I read that you found a solution, but I didn't understand it very well.

Could you tell me more how to resolve this problem. I have create the connection manager and a cant set it into the DataReader Source

Thank you.

|||

Data Reader source accepts connection manager of Type ADO.NET only.

so First you have to create a Connection Manager to your Data Base using ADO.net Provider ONLY.

open the advanced editior of data reader source, go to connection managers tab, you will see IdbConnection , beside that there will be another column named connection manger, select your created connection manager there (ADO.Net one). Then go to Component properties tab and in sql command enter your sql query. go to columns mapping tab ..now you can see your columns.

|||thank you for your reply. i resolve the problem.|||

hello,

i thought that I resolve the problem of the connection but there was another problem that didn't permit me to save the connection to the advanced editor.

the error is "Component is already connected. The component needs to be disconnected before attempting to connect it."

Can you help me?

Can't assign connection manager object to DataReader Source

I'm trying to create a DataReader source object using a working ADO.NET Oracle Client connection object that exists in the connection manager.

Problem:

When I open the editor the DataReaderSrc component shows only one row under the Connection Managers tab:

Name=IDbConnection
Connection Manager=blank
Description=Managed connection manager

I cannot assign the ADO.NET connection (or any connections). I see a warning at the bottom of the Connection Managers tab:

"Not all connection managers have been set. Set all connection managers."

When I click refresh the warning message changes to:

"The runtime connection manager with the ID "" cannot be found. Verify that the connection manager collection has a connection manager with that ID."

I am prevented from removing the IDbConnection or assigning my Connection Manager object to the DataReader Source.

Thanks, -- Mike

I also have the same problem, I'm sure it must be some tiny detail somewhere / something very basic, but I have been unable to fix it. Can someone help? Thanks!

Hector

|||

I had the same problem because I was using the wrong Provider when specifying my Data Source.

Hope it helps,

Nuno

|||

I had the same problem. In my case the 'advanced editor for datareader source' is very, very confusing. First of all, you have to create a connection manager, which I did already. But, it was not at all intuitive that you have to click on the box under 'connection manager' and select a connection manager. By default the box is black and grayed out like both the other fields which you cannot change. Gee, thanks redmond.

|||Thanks for taking the time to post this answer. I finally learned this last week at a SQL Server training class. The instructor pointed out that you actually need to change the disabled looking box.|||

Hello.

I read that you found a solution, but I didn't understand it very well.

Could you tell me more how to resolve this problem. I have create the connection manager and a cant set it into the DataReader Source

Thank you.

|||

Data Reader source accepts connection manager of Type ADO.NET only.

so First you have to create a Connection Manager to your Data Base using ADO.net Provider ONLY.

open the advanced editior of data reader source, go to connection managers tab, you will see IdbConnection , beside that there will be another column named connection manger, select your created connection manager there (ADO.Net one). Then go to Component properties tab and in sql command enter your sql query. go to columns mapping tab ..now you can see your columns.

|||thank you for your reply. i resolve the problem.|||

hello,

i thought that I resolve the problem of the connection but there was another problem that didn't permit me to save the connection to the advanced editor.

the error is "Component is already connected. The component needs to be disconnected before attempting to connect it."

Can you help me?

sql

cant aquire a managed connection, SSIS

HI I am creating an integration service and have created a connection
manager. I tested it and the connection passed. I then wend to the data
flow source and added a data reader source but get the error , cannot aquire
a managed connection from the runtime connection manager. I am trying to
create a simple package that will read data from a database using a query and
then write it out to an excel file. I am familiar with the old 2000 DTS
package development.
thanks.
--
Paul G
Software engineer.Paul,
I'm in the same boat and ended up having to go buy the Microsoft Press SSIS
book. I'm still going through it.
You probably will have to do the same as SSIS help seems to be limited in
here.
Good luck,
Jay
"Paul" <Paul@.discussions.microsoft.com> wrote in message
news:722EC193-D7B7-4B20-AB4F-1303F4AB625C@.microsoft.com...
> HI I am creating an integration service and have created a connection
> manager. I tested it and the connection passed. I then wend to the data
> flow source and added a data reader source but get the error , cannot
> aquire
> a managed connection from the runtime connection manager. I am trying to
> create a simple package that will read data from a database using a query
> and
> then write it out to an excel file. I am familiar with the old 2000 DTS
> package development.
> thanks.
> --
> Paul G
> Software engineer.|||Hi Jay I was able to get it working. I now have an Integrated Services
packages that moves data from one database to another and if successful
updates a table in the original database. Also if successful I have it write
out in a message box using vbscript. Also if it fails I have it wright out
an error message in a message box.
If I remember correctly I selected the connection from the properties of the
dataflow task. Also on the connection I used the ADO.net. In addition I
changed the authentication mode to mixed (this is in the properties of the
database). Hope this helps.
--
Paul G
Software engineer.
"Jay" wrote:
> Paul,
> I'm in the same boat and ended up having to go buy the Microsoft Press SSIS
> book. I'm still going through it.
> You probably will have to do the same as SSIS help seems to be limited in
> here.
> Good luck,
> Jay
> "Paul" <Paul@.discussions.microsoft.com> wrote in message
> news:722EC193-D7B7-4B20-AB4F-1303F4AB625C@.microsoft.com...
> > HI I am creating an integration service and have created a connection
> > manager. I tested it and the connection passed. I then wend to the data
> > flow source and added a data reader source but get the error , cannot
> > aquire
> > a managed connection from the runtime connection manager. I am trying to
> > create a simple package that will read data from a database using a query
> > and
> > then write it out to an excel file. I am familiar with the old 2000 DTS
> > package development.
> > thanks.
> > --
> > Paul G
> > Software engineer.
>
>

Thursday, March 22, 2012

Cant Add new connection in SQL SERVER EXPRESS

Hi,

I am relatively new to this. I have installed VB 2005 and that has installed a version of SQL Server 2005 Express on my local development machine. I am using VB to develop some demo sites and i can create DB's in the App_Data file and they work when I test and run then by pressing Ctrl + F5.

However i have some demo tutorials that require Northwind and Pubs to do them. So i have installed Northwind and Pubs using the cms prompt and the InstNwnd.sql install. They said everything has been installed fine.

This is where the problem starts. I open new connection in VB, or asses for that matter and try to open my local server machine (just my desktop running WindowsXP pro), Which is called Optiplex. Sometimes i get the optiplex appear in the dropdown that asks for your to choose a server and other times it doesnt. Eevn if the machine appears it doesnt let me chose Pubs or northwind from the second drop down.

I think i must have SQexpress running on the machined named Optiplex because i have the SQL server configuartion manger on it. That tells me i am running SQL Server(SQLEXPRESS) and SQL Server Browser both switched on and running. By the way i have set my SQL manager to run as Local service.

One thing that i consider strange is that when i have had SQLServer Express running on other machines normally there was a little icon running in the right hand corner of the the task bar.

Does anyone know what is going on with my mchine and have i got the SQL server setup correctly?

Just one last piece of additionally information is that i have a folder called C:\SQL Server 2000 Sample Databases which is where the MDF files are located.

Thanks a million Sanson

Hi Sanson,

Could you give me some more details? Which database will the appliation connect to? SQL Server 2005 Express or SQL Server 2000 ? You mentioned that you have a folder called C:\SQL Server 200 Sample Database which is where the MDF files located, Have these MDF files (Northwind and Pubs) be attached to SQL Server by using Management Satudio? If not,pls follow the steps below:

1. Copy your .mdf file and .ldf(if exists) to another folder.
2. Right click on Databases, and select Attach from the popup menu.
3. In the Attach Databases dialog box,click Add button and select the .mdf file.
4. Click OK to finish, and the database will be atached to your database list in Management Studio.

Thanks.

|||

Thanks for your help.

What had happened was i hadnt installed SQL Management Studio. Once i did everything got sorted out and they were in there.

However i still cant use the upsizing wizard in Access to upsize a database to SQL. I always get a connect error.

Now however i get a the name of my server come up in the dropdown box, which is somethong i suppose.

sql

cant access to remote MS SQL server!

Here is the connection string i used:

"Data Source=<IP>,1433;Network Library=DBMSSOCN;Initial Catalog=<dbname>;User ID=sa;Password=<pwd>;"

i use that to connect to the remote SQL server, which has status of port 1433 at "Stealth"... do i need to open the port complete, if yes how i do that ?

does the SQL Server must use SQL authentication ?

Your help is greatly appreciated.Try this:

server=<ip>;uid=sa;pwd=<pwd>;database=<dbname
Remove everything else from the connection string.|||thnx, btw, do i need to add the port # after the IP ?|||yes, if it is not default (not 1433)
if it is 1433, there is no need to specify it

cant access the datasource control

When I put a sqldatasource in my page and want to configure it and add a new connection to it I recieve this error : "object reference not set to an instance of an object" . Do you have any idea about solving this problem. please help me Thanks

Hi,

when asking a question about code or when you get an error always try to provide therelevant pieces of code and the error message that you get. This helps the people around here to better help you out.

Grz, Kris.

|||

My program has only a simple datagrid that should get data from a sql table and show it.This is only a test after changing the IIS settings. You can see my code here:

When I run this program I don't recieve any error but the explorer shows the blank page. When I try making connectionstring via sqldatasource I recieve that error:"the object reference...".thanks for helping

public

partialclassado1 : System.Web.UI.Page

{

privatevoid bindgrid()

{

string conStr ="Data Source=.;Initial Catalog=Northwind;Persist Security Info=True;User ID=sa";SqlConnection conn =newSqlConnection(conStr);// Open the connection

conn.Open();

// Create a data adapter objectSqlDataAdapter adapter =newSqlDataAdapter("SELECT * FROM testt", conn);DataSet ds =newDataSet();

adapter.Fill(ds);

GridView1.DataBind();

conn.Close();

}

protectedvoid Page_Load(object sender,EventArgs e)

{

if (!IsPostBack)

{

bindgrid();

}}}

///////////////////////////////

the body of aspx file is here:

<

body><formid="form1"runat="server"><div> <asp:SqlDataSourceID="SqlDataSource1"runat="server"></asp:SqlDataSource><asp:GridViewID="GridView1"runat="server"></asp:GridView></div></form>

</

body>

/////////////////////////////////////

|||

Hi,

hsharifi:

publicpartialclassado1 : System.Web.UI.Page

{

privatevoid bindgrid()

{

string conStr ="Data Source=.;Initial Catalog=Northwind;Persist Security Info=True;User ID=sa";

SqlConnection conn =newSqlConnection(conStr);

// Open the connection

conn.Open();

// Create a data adapter objectSqlDataAdapter adapter =newSqlDataAdapter("SELECT * FROM testt", conn);DataSet ds =newDataSet();

adapter.Fill(ds);

GridView1.DataBind();

conn.Close();

}

protectedvoid Page_Load(object sender,EventArgs e)

{

if (!IsPostBack)

{

bindgrid();

}}}

///////////////////////////////

the body of aspx file is here:

<

body><formid="form1"runat="server"><div> <asp:SqlDataSourceID="SqlDataSource1"runat="server"></asp:SqlDataSource><asp:GridViewID="GridView1"runat="server"></asp:GridView></div></form>

</

body>

/////////////////////////////////////

it seems like you're trying to do 2 things here: you want to use code & the SqlDataSource control together, that's a no go.

Get rid of the SqlDataSource control on your page and in the codefile, just before you call the DataBind() method place this line:

GridView1.DataSource = ds;
GridView1.DataBind();

Grz, Kris.

|||

Hi Xlll ,and thank you for replying me.

I did the thing that you said but my problem is still going on. After running my program the browser shows a blank page. I had to change many settings in IIS, do you think this problem is related to these changes or may be I should reinstall vs.net after that.

I would be glad to hear your opinion. Thanks

|||

Hi,

before re?nstalling you can first let the aspnet_regiis -i tool do its work to set the correct settings for the correct framework in IIS.

Something else that you can try: place a TextBox, Button and Label control on a webform. In the Button Click event you place this code:

Label1.Text = TextBox1.Text

and see if it executes well on your server. It's probably something stupid but I like to use such scenario's to quickly test out if ASP.NET is installed properly on a machine.

Grz, Kris.

Tuesday, March 20, 2012

Can't access OLEDB datasource

The following problem is occuring when I try to access a
table either via an oledb connection or via a linked
server
I can enter the query in the rs/text box and run it
sucessfully. If I either goto edit the query via the
query tool or select the data option. Visual Studio
crashes.
This scenario reproduces the error
select * from link...table, however
this scenario works
select * from openquery(link,'select * from table')
I have downloaded sp1 for reporting services
thanks
DanAre you using the generic query designer, or are you using the graphical
query desinger?
-Lukasz
This posting is provided "AS IS" with no warranties, and confers no rights.
"Dan" <anonymous@.discussions.microsoft.com> wrote in message
news:b92401c479a8$2a760220$a601280a@.phx.gbl...
> The following problem is occuring when I try to access a
> table either via an oledb connection or via a linked
> server
> I can enter the query in the rs/text box and run it
> sucessfully. If I either goto edit the query via the
> query tool or select the data option. Visual Studio
> crashes.
> This scenario reproduces the error
> select * from link...table, however
> this scenario works
> select * from openquery(link,'select * from table')
> I have downloaded sp1 for reporting services
> thanks
> Dan|||Thank you for the response, I can type in a query in the
generic designed, however if I select edit which is
supposed to launch the graphic tool, it crashes. This is
the same behavior whether I use the oledb interface or
try to access the same table via a linked-server
Regards
>--Original Message--
>Are you using the generic query designer, or are you
using the graphical
>query desinger?
>-Lukasz
>
>--
>This posting is provided "AS IS" with no warranties, and
confers no rights.
>
>"Dan" <anonymous@.discussions.microsoft.com> wrote in
message
>news:b92401c479a8$2a760220$a601280a@.phx.gbl...
>> The following problem is occuring when I try to access
a
>> table either via an oledb connection or via a linked
>> server
>> I can enter the query in the rs/text box and run it
>> sucessfully. If I either goto edit the query via the
>> query tool or select the data option. Visual Studio
>> crashes.
>> This scenario reproduces the error
>> select * from link...table, however
>> this scenario works
>> select * from openquery(link,'select * from table')
>> I have downloaded sp1 for reporting services
>> thanks
>> Dan
>
>.
>|||Unfortunately, the graphical query editor is a component of Visual Studio
which we reuse. If you send me your query, I can file a bug on their side.
-Lukasz
This posting is provided "AS IS" with no warranties, and confers no rights.
"dan" <anonymous@.discussions.microsoft.com> wrote in message
news:befe01c479d1$f409b860$a501280a@.phx.gbl...
> Thank you for the response, I can type in a query in the
> generic designed, however if I select edit which is
> supposed to launch the graphic tool, it crashes. This is
> the same behavior whether I use the oledb interface or
> try to access the same table via a linked-server
> Regards
>>--Original Message--
>>Are you using the generic query designer, or are you
> using the graphical
>>query desinger?
>>-Lukasz
>>
>>--
>>This posting is provided "AS IS" with no warranties, and
> confers no rights.
>>
>>"Dan" <anonymous@.discussions.microsoft.com> wrote in
> message
>>news:b92401c479a8$2a760220$a601280a@.phx.gbl...
>> The following problem is occuring when I try to access
> a
>> table either via an oledb connection or via a linked
>> server
>> I can enter the query in the rs/text box and run it
>> sucessfully. If I either goto edit the query via the
>> query tool or select the data option. Visual Studio
>> crashes.
>> This scenario reproduces the error
>> select * from link...table, however
>> this scenario works
>> select * from openquery(link,'select * from table')
>> I have downloaded sp1 for reporting services
>> thanks
>> Dan
>>
>>.|||Thanks
Here is the example: SELECT * FROM NSXLINK...KNA1
NSXLINK is an OLEDB compliant linked server kna1 is the
table. If you select edit you get the error.
If however you submit the following query
SELECT * FROM OPENQUERY(NSXLINK,'SELECT * FROM NSXLINK')
it works. The same problem will appear if you use the
OLEDB provider directly, without the linked server
If you want I can get the error from the program that is
generated
thanks again
dan
>--Original Message--
>Unfortunately, the graphical query editor is a component
of Visual Studio
>which we reuse. If you send me your query, I can file
a bug on their side.
>-Lukasz
>
>--
>This posting is provided "AS IS" with no warranties, and
confers no rights.
>
>"dan" <anonymous@.discussions.microsoft.com> wrote in
message
>news:befe01c479d1$f409b860$a501280a@.phx.gbl...
>> Thank you for the response, I can type in a query in
the
>> generic designed, however if I select edit which is
>> supposed to launch the graphic tool, it crashes. This
is
>> the same behavior whether I use the oledb interface or
>> try to access the same table via a linked-server
>> Regards
>>--Original Message--
>>Are you using the generic query designer, or are you
>> using the graphical
>>query desinger?
>>-Lukasz
>>
>>--
>>This posting is provided "AS IS" with no warranties,
and
>> confers no rights.
>>
>>"Dan" <anonymous@.discussions.microsoft.com> wrote in
>> message
>>news:b92401c479a8$2a760220$a601280a@.phx.gbl...
>> The following problem is occuring when I try to
access
>> a
>> table either via an oledb connection or via a linked
>> server
>> I can enter the query in the rs/text box and run it
>> sucessfully. If I either goto edit the query via the
>> query tool or select the data option. Visual Studio
>> crashes.
>> This scenario reproduces the error
>> select * from link...table, however
>> this scenario works
>> select * from openquery(link,'select * from table')
>> I have downloaded sp1 for reporting services
>> thanks
>> Dan
>>
>>.
>
>.
>

Saturday, February 25, 2012

Cannot start Microsoft SQL Server agent & Enterprise manager

Hi:
I am receiving the following error message while trying to open Enterprise
Manager in MSSQL 2000 Server.
A connection could not be established to ABCD
Reason : I/O error 1117(the request could not performed because of an I/O
device error.) detected during read at offset 0x00000000b1e000 in file
'Drive:\Microsoft SQL Server\MSSQL\data\master.mdf'..
Please verify SQL Server is running and check your SQL Server registration
properties (by right cliking on the ABCD node) and try again.
This is a Windows 2000 server (Service Pack 4) + MSSQL 2000 (service Pack
3). The MSSQL server service SQL Server Agent services are running under
local system. This is a Standalone machine.
Help is required on an urgent basis as this is a production server.
With Regards
Mitul
You have a problem with the mdf file for your master database file. Possibly the file is locked by
some other process (like anti-virus). If that is the case, try again. If you are unlucky, the master
mdf file is corrupt for some reason, and you have to go the rebuildm.exe route.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Mitul" <Mitul@.discussions.microsoft.com> wrote in message
news:46466B5B-D821-4C07-BD8C-8996EBAD7915@.microsoft.com...
> Hi:
> I am receiving the following error message while trying to open Enterprise
> Manager in MSSQL 2000 Server.
>
> A connection could not be established to ABCD
> Reason : I/O error 1117(the request could not performed because of an I/O
> device error.) detected during read at offset 0x00000000b1e000 in file
> 'Drive:\Microsoft SQL Server\MSSQL\data\master.mdf'..
> Please verify SQL Server is running and check your SQL Server registration
> properties (by right cliking on the ABCD node) and try again.
>
> This is a Windows 2000 server (Service Pack 4) + MSSQL 2000 (service Pack
> 3). The MSSQL server service SQL Server Agent services are running under
> local system. This is a Standalone machine.
> Help is required on an urgent basis as this is a production server.
> With Regards
> Mitul

Cannot start Microsoft SQL Server agent & Enterprise manager

Hi:
I am receiving the following error message while trying to open Enterprise
Manager in MSSQL 2000 Server.
---
A connection could not be established to ABCD
Reason : I/O error 1117(the request could not performed because of an I/O
device error.) detected during read at offset 0x00000000b1e000 in file
'Drive:\Microsoft SQL Server\MSSQL\data\master.mdf'..
Please verify SQL Server is running and check your SQL Server registration
properties (by right cliking on the ABCD node) and try again.
---
This is a Windows 2000 server (Service Pack 4) + MSSQL 2000 (service Pack
3). The MSSQL server service SQL Server Agent services are running under
local system. This is a Standalone machine.
Help is required on an urgent basis as this is a production server.
With Regards
MitulYou have a problem with the mdf file for your master database file. Possibly the file is locked by
some other process (like anti-virus). If that is the case, try again. If you are unlucky, the master
mdf file is corrupt for some reason, and you have to go the rebuildm.exe route.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Mitul" <Mitul@.discussions.microsoft.com> wrote in message
news:46466B5B-D821-4C07-BD8C-8996EBAD7915@.microsoft.com...
> Hi:
> I am receiving the following error message while trying to open Enterprise
> Manager in MSSQL 2000 Server.
> ---
> A connection could not be established to ABCD
> Reason : I/O error 1117(the request could not performed because of an I/O
> device error.) detected during read at offset 0x00000000b1e000 in file
> 'Drive:\Microsoft SQL Server\MSSQL\data\master.mdf'..
> Please verify SQL Server is running and check your SQL Server registration
> properties (by right cliking on the ABCD node) and try again.
> ---
> This is a Windows 2000 server (Service Pack 4) + MSSQL 2000 (service Pack
> 3). The MSSQL server service SQL Server Agent services are running under
> local system. This is a Standalone machine.
> Help is required on an urgent basis as this is a production server.
> With Regards
> Mitul

Cannot start configuration manager on 1 of our active nodes

On one of our active nodes we cannot start the configuration manager but we
can start management studio.
We get the error message "Connection to target machine cannot be made in a
timely fashion". Any ideas on what causes this and how to fix?
Thanks
Is this for a Named Instance installation, on a non-standard port?
If so, then it probably works fine on the active node, but the remote node
times out?
Create a client-side alias on each node; sometimes the port resolution does
not work properly.
Are you running the SQL Browser service on each node?
Sincerely,
Anthony Thomas

"Randy" <Randy@.discussions.microsoft.com> wrote in message
news:A3FC4759-C823-400D-B9C0-651F5BA7BCD1@.microsoft.com...
> On one of our active nodes we cannot start the configuration manager but
we
> can start management studio.
> We get the error message "Connection to target machine cannot be made in a
> timely fashion". Any ideas on what causes this and how to fix?
> Thanks

Sunday, February 19, 2012

Cannot Set Connection String For Bulk Insert Source Connection

I came across something strange today. I was wondering I was doing something wrong.

I want to go through a directory and get files and assign the Fully Qualified File Name to a User Variable. I want to use that variable as a connection string within Expression in Bulk Insert Task Source Connection, Data Flow Task and File System Task. It is working fine within Data Flow Task and File System task. It is NOT working for Bulk Insert. Did you come across this or am I doing something wrong?

- Expressions
ConnectionString @.[User::FileName]

Did anyone come across this before?

Thanks

Sutha

Seems to be a problem to me, it does not work within the context of a for each loop, keep getting the error message, connection not valid.

I have written this script and placed it into an activex task before the bulk insert, this seems to fix it.

Dim connmgr As ConnectionManager = Dts.Connections("[your connection name]")
connmgr.ConnectionString = Dts.Variables("User::filename").Value.ToString()
connmgr.AcquireConnection(Nothing)

Hope this helps !

Mark|||

Cheers Mark. It does work fine. I put a script task inside Foreach, just before Bulk Insert to set the connections.

Still thinks its a Bug. Anyone from MS can confirm it. If so do you want me to raise a Bug for this?

Thanks for your help

Sutha

|||

Hello Sutha,

I am trying to achieve the same. Can you help me.

Foreach loop container is reading all the files in the specified folder.

I can also read the variable. But I am having difficulties in assiging this variable file name to Bulk Insert, connection, Source connection.

thanks & regards

radha.

|||I could not reproduce this issue.

1. I could set the value of the "SourceConnection" property to the name of the connection I want to use in my bulk insert task and it works.

2. I can also assign the value of the "ConnectionString" property of the connection to a variable that points to the file and it works.
|||

I am having same issue:

Simple package: Foreach Loop, inside ForEach Loop is a Bulk Insert Task.

I set the variable User::FileName in the variable Mappings of the Foreach Loop. I create a FlatFile connection in connection manager and go into the Expressions of the flat file connection and set the ConnectionString to be @.[User::FileName]. I set the connection in the Bulk Insert to be the Flat file connection I created and I run the package... I get the error: "The specified connection "XYZ Files" is either not valid, or points to an invalid object. To continue, specify a valid connection." Its very reproduceable.

Been fighting with this all day... can someone post step-by-step how to do the workaround where the script sets the connection?

|||Dim connmgr As ConnectionManager = Dts.Connections("Name of Flat File Conn Manager")
connmgr.ConnectionString = Dts.Variables("Var Name of Full path and filename").Value.ToString()
connmgr.AcquireConnection(Nothing)|||See this link for a Dec 27 Blog. http://denster.spaces.live.com/

Cannot Set Connection String For Bulk Insert Source Connection

I came across something strange today. I was wondering I was doing something wrong.

I want to go through a directory and get files and assign the Fully Qualified File Name to a User Variable. I want to use that variable as a connection string within Expression in Bulk Insert Task Source Connection, Data Flow Task and File System Task. It is working fine within Data Flow Task and File System task. It is NOT working for Bulk Insert. Did you come across this or am I doing something wrong?

- Expressions
ConnectionString @.[User::FileName]

Did anyone come across this before?

Thanks

Sutha

Seems to be a problem to me, it does not work within the context of a for each loop, keep getting the error message, connection not valid.

I have written this script and placed it into an activex task before the bulk insert, this seems to fix it.

Dim connmgr As ConnectionManager = Dts.Connections("[your connection name]")
connmgr.ConnectionString = Dts.Variables("User::filename").Value.ToString()
connmgr.AcquireConnection(Nothing)

Hope this helps !

Mark|||

Cheers Mark. It does work fine. I put a script task inside Foreach, just before Bulk Insert to set the connections.

Still thinks its a Bug. Anyone from MS can confirm it. If so do you want me to raise a Bug for this?

Thanks for your help

Sutha

|||

Hello Sutha,

I am trying to achieve the same. Can you help me.

Foreach loop container is reading all the files in the specified folder.

I can also read the variable. But I am having difficulties in assiging this variable file name to Bulk Insert, connection, Source connection.

thanks & regards

radha.

|||I could not reproduce this issue.

1. I could set the value of the "SourceConnection" property to the name of the connection I want to use in my bulk insert task and it works.

2. I can also assign the value of the "ConnectionString" property of the connection to a variable that points to the file and it works.
|||

I am having same issue:

Simple package: Foreach Loop, inside ForEach Loop is a Bulk Insert Task.

I set the variable User::FileName in the variable Mappings of the Foreach Loop. I create a FlatFile connection in connection manager and go into the Expressions of the flat file connection and set the ConnectionString to be @.[User::FileName]. I set the connection in the Bulk Insert to be the Flat file connection I created and I run the package... I get the error: "The specified connection "XYZ Files" is either not valid, or points to an invalid object. To continue, specify a valid connection." Its very reproduceable.

Been fighting with this all day... can someone post step-by-step how to do the workaround where the script sets the connection?

|||Dim connmgr As ConnectionManager = Dts.Connections("Name of Flat File Conn Manager")
connmgr.ConnectionString = Dts.Variables("Var Name of Full path and filename").Value.ToString()
connmgr.AcquireConnection(Nothing)|||See this link for a Dec 27 Blog. http://denster.spaces.live.com/

Cannot Set Connection String For Bulk Insert Source Connection

I came across something strange today. I was wondering I was doing something wrong.

I want to go through a directory and get files and assign the Fully Qualified File Name to a User Variable. I want to use that variable as a connection string within Expression in Bulk Insert Task Source Connection, Data Flow Task and File System Task. It is working fine within Data Flow Task and File System task. It is NOT working for Bulk Insert. Did you come across this or am I doing something wrong?

- Expressions
ConnectionString @.[User::FileName]

Did anyone come across this before?

Thanks

Sutha

Seems to be a problem to me, it does not work within the context of a for each loop, keep getting the error message, connection not valid.

I have written this script and placed it into an activex task before the bulk insert, this seems to fix it.

Dim connmgr As ConnectionManager = Dts.Connections("[your connection name]")
connmgr.ConnectionString = Dts.Variables("User::filename").Value.ToString()
connmgr.AcquireConnection(Nothing)

Hope this helps !

Mark|||

Cheers Mark. It does work fine. I put a script task inside Foreach, just before Bulk Insert to set the connections.

Still thinks its a Bug. Anyone from MS can confirm it. If so do you want me to raise a Bug for this?

Thanks for your help

Sutha

|||

Hello Sutha,

I am trying to achieve the same. Can you help me.

Foreach loop container is reading all the files in the specified folder.

I can also read the variable. But I am having difficulties in assiging this variable file name to Bulk Insert, connection, Source connection.

thanks & regards

radha.

|||I could not reproduce

this issue.

1. I could set the value of the "SourceConnection" property to

the name of the connection I want to use in my bulk insert task and it

works.

2. I can also assign the value of the "ConnectionString" property of the connection to a variable that points to the file and it works.

|||

I am having same issue:

Simple package: Foreach Loop, inside ForEach Loop is a Bulk Insert Task.

I set the variable User::FileName in the variable Mappings of the Foreach Loop. I create a FlatFile connection in connection manager and go into the Expressions of the flat file connection and set the ConnectionString to be @.[User::FileName]. I set the connection in the Bulk Insert to be the Flat file connection I created and I run the package... I get the error: "The specified connection "XYZ Files" is either not valid, or points to an invalid object. To continue, specify a valid connection." Its very reproduceable.

Been fighting with this all day... can someone post step-by-step how to do the workaround where the script sets the connection?

|||Dim connmgr As ConnectionManager = Dts.Connections("Name of Flat File Conn Manager")
connmgr.ConnectionString = Dts.Variables("Var Name of Full path and filename").Value.ToString()
connmgr.AcquireConnection(Nothing)|||See this link for a Dec 27 Blog. http://denster.spaces.live.com/

Cannot Set Connection String For Bulk Insert Source Connection

I came across something strange today. I was wondering I was doing something wrong.

I want to go through a directory and get files and assign the Fully Qualified File Name to a User Variable. I want to use that variable as a connection string within Expression in Bulk Insert Task Source Connection, Data Flow Task and File System Task. It is working fine within Data Flow Task and File System task. It is NOT working for Bulk Insert. Did you come across this or am I doing something wrong?

- Expressions
ConnectionString @.[User::FileName]

Did anyone come across this before?

Thanks

Sutha

Seems to be a problem to me, it does not work within the context of a for each loop, keep getting the error message, connection not valid.

I have written this script and placed it into an activex task before the bulk insert, this seems to fix it.

Dim connmgr As ConnectionManager = Dts.Connections("[your connection name]")
connmgr.ConnectionString = Dts.Variables("User::filename").Value.ToString()
connmgr.AcquireConnection(Nothing)

Hope this helps !

Mark|||

Cheers Mark. It does work fine. I put a script task inside Foreach, just before Bulk Insert to set the connections.

Still thinks its a Bug. Anyone from MS can confirm it. If so do you want me to raise a Bug for this?

Thanks for your help

Sutha

|||

Hello Sutha,

I am trying to achieve the same. Can you help me.

Foreach loop container is reading all the files in the specified folder.

I can also read the variable. But I am having difficulties in assiging this variable file name to Bulk Insert, connection, Source connection.

thanks & regards

radha.

|||I could not reproduce

this issue.

1. I could set the value of the "SourceConnection" property to

the name of the connection I want to use in my bulk insert task and it

works.

2. I can also assign the value of the "ConnectionString" property of the connection to a variable that points to the file and it works.

|||

I am having same issue:

Simple package: Foreach Loop, inside ForEach Loop is a Bulk Insert Task.

I set the variable User::FileName in the variable Mappings of the Foreach Loop. I create a FlatFile connection in connection manager and go into the Expressions of the flat file connection and set the ConnectionString to be @.[User::FileName]. I set the connection in the Bulk Insert to be the Flat file connection I created and I run the package... I get the error: "The specified connection "XYZ Files" is either not valid, or points to an invalid object. To continue, specify a valid connection." Its very reproduceable.

Been fighting with this all day... can someone post step-by-step how to do the workaround where the script sets the connection?

|||Dim connmgr As ConnectionManager = Dts.Connections("Name of Flat File Conn Manager")
connmgr.ConnectionString = Dts.Variables("Var Name of Full path and filename").Value.ToString()
connmgr.AcquireConnection(Nothing)|||See this link for a Dec 27 Blog. http://denster.spaces.live.com/

Cannot Set Connection String For Bulk Insert Source Connection

I came across something strange today. I was wondering I was doing something wrong.

I want to go through a directory and get files and assign the Fully Qualified File Name to a User Variable. I want to use that variable as a connection string within Expression in Bulk Insert Task Source Connection, Data Flow Task and File System Task. It is working fine within Data Flow Task and File System task. It is NOT working for Bulk Insert. Did you come across this or am I doing something wrong?

- Expressions
ConnectionString @.[User::FileName]

Did anyone come across this before?

Thanks

Sutha

Seems to be a problem to me, it does not work within the context of a for each loop, keep getting the error message, connection not valid.

I have written this script and placed it into an activex task before the bulk insert, this seems to fix it.

Dim connmgr As ConnectionManager = Dts.Connections("[your connection name]")
connmgr.ConnectionString = Dts.Variables("User::filename").Value.ToString()
connmgr.AcquireConnection(Nothing)

Hope this helps !

Mark|||

Cheers Mark. It does work fine. I put a script task inside Foreach, just before Bulk Insert to set the connections.

Still thinks its a Bug. Anyone from MS can confirm it. If so do you want me to raise a Bug for this?

Thanks for your help

Sutha

|||

Hello Sutha,

I am trying to achieve the same. Can you help me.

Foreach loop container is reading all the files in the specified folder.

I can also read the variable. But I am having difficulties in assiging this variable file name to Bulk Insert, connection, Source connection.

thanks & regards

radha.

|||I could not reproduce this issue.

1. I could set the value of the "SourceConnection" property to the name of the connection I want to use in my bulk insert task and it works.

2. I can also assign the value of the "ConnectionString" property of the connection to a variable that points to the file and it works.
|||

I am having same issue:

Simple package: Foreach Loop, inside ForEach Loop is a Bulk Insert Task.

I set the variable User::FileName in the variable Mappings of the Foreach Loop. I create a FlatFile connection in connection manager and go into the Expressions of the flat file connection and set the ConnectionString to be @.[User::FileName]. I set the connection in the Bulk Insert to be the Flat file connection I created and I run the package... I get the error: "The specified connection "XYZ Files" is either not valid, or points to an invalid object. To continue, specify a valid connection." Its very reproduceable.

Been fighting with this all day... can someone post step-by-step how to do the workaround where the script sets the connection?

|||Dim connmgr As ConnectionManager = Dts.Connections("Name of Flat File Conn Manager")
connmgr.ConnectionString = Dts.Variables("Var Name of Full path and filename").Value.ToString()
connmgr.AcquireConnection(Nothing)|||See this link for a Dec 27 Blog. http://denster.spaces.live.com/