Showing posts with label network. Show all posts
Showing posts with label network. Show all posts

Tuesday, March 27, 2012

Error: An error occurred due to no connection

This error is for Nov RTM running under "NETWORK SERVICE" account.

I created a data source "MyDataSource". It looks like:
<DataSource xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dwd="http://schemas.microsoft.com/DataWarehouse/Designer/1.0" xsi:type="RelationalDataSource" dwd:design-time-name="2d2b4fc8-af5c-4314-9155-384afd11fb70" xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<ID>MyDataSource</ID>
<Name>MyDataSource</Name>
<CreatedTimestamp>0001-01-01T05:00:00Z</CreatedTimestamp>
<LastSchemaUpdate>0001-01-01T05:00:00Z</LastSchemaUpdate>
<ConnectionString>Provider=SQLOLEDB.1;Data Source=dbserver\my_instance;Integrated Security=SSPI;Initial Catalog=MyDataSource</ConnectionString>
<ConnectionStringSecurity>Unchanged</ConnectionStringSecurity>
<ImpersonationInfo>
<ImpersonationMode>ImpersonateServiceAccount</ImpersonationMode>
<ImpersonationInfoSecurity>Unchanged</ImpersonationInfoSecurity>
</ImpersonationInfo>
<Timeout>PT0S</Timeout>
</DataSource>

In my package, I obtain a new connection from the data source (test connection succeeds). I use a data flow task. Inside the data flow task I have a flat file source and an Ole Db Destination. For configuring OleDbDestination, I can see in the drop-down a list of tables in my database. When I select the desired table and click "preview", I get:
TITLE: Microsoft Visual Studio

Error at Data Flow Task - my task [OLE DB Destination [831]]: An error occurred due to no connection. A connection is required when requesting metadata.

--
ADDITIONAL INFORMATION:

Exception from HRESULT: 0xC0202022 (Microsoft.SqlServer.DTSPipelineWrap)


BUTTONS:

OK
TIA,
Nitesh

Can you please check that you are not working with "Work Offline" settings.

Friday, March 9, 2012

Error with using nvarchar datatype

Hi, I have created a database using VWD to keep values of urls and have structured it as...

Prefix (http://, network name),address(www.name.com), andname (name of address), theaddress field has been defined as a nvarchar(MAX).

Most of the addresses updated into the address field work, except something like:www.java-scripts.net/javascripts/Image-Rollover-Script.phtml.

I get this error:

Cannot open user default database. Login failed.
Login failed for user 'NETWORKNAME\ASPNET'.

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: Cannot open user default database. Login failed.
Login failed for user 'NETWORKNAME\ASPNET'.

Source Error:

Line 1176: if (((this.Adapter.InsertCommand.Connection.State & System.Data.ConnectionState.Open) Line 1177: != System.Data.ConnectionState.Open)) {Line 1178: this.Adapter.InsertCommand.Connection.Open();Line 1179: }Line 1180: try {

I can insert something likewww.google.com into theaddresses field without any errors. Any ideas why?
If it is a nvarchar type it should be able to except all sorts of characters??

The error itself has nothing to do with datatypes. It's a connection error which implies that you have invalid credentials in the connection string (it seems to run using integrated Windows authentication).

|||

Hello, I apologise, but i was checking something in the database when I was writing this post. After closing the connection and re-entering the field entry >www.java-scripts.net/javascripts/Image-Rollover-Script.phtml

Here is the error i have been getting:

Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

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.ConstraintException: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

Source Error:

Line 1095: this.Adapter.SelectCommand = this.CommandCollection[0];Line 1096: TasksDataSet.intranet_addressesDataTable dataTable = new TasksDataSet.intranet_addressesDataTable();Line 1097: this.Adapter.Fill(dataTable);Line 1098: return dataTable;Line 1099: }

Hope this makes sense. If I delete the submitted value from the database and re-enter something likewww.google.com, it works fine.
So why would a URL likewww.java-scripts.net/javascripts/Image-Rollover-Script.phtml cause the above error?

|||

Ah, the dreaded ConstraintException.. The error is in the DataTable, not in the query execution. You can get a better error message by catching the exception and sending it to this method:

public static string ConstraintExceptionToString(ConstraintException ce, DataTable dt) {return"Constraint Exception [" + ce.Message +"] in " + dt.TableName +" (" + dt.Rows.Count +" rows)\n" + DataTableErrorsToString(dt);}public static string DataTableErrorsToString(DataTable dt) {StringBuilder sb =new StringBuilder();for (int x=0; xif (dr.HasErrors) {sb.Append("\tError in row " + x +": " + dr.RowError +"\n");}}return sb.ToString();}
|||

Very interesting, where abouts would I place the above script?

|||

Oohh...don't say "script"... .NET developers will look strangely upon you...Smile

The methods are just helper methods that will retrieve the actual constraint error. For simplicity's sake we can add them to the same class as your data filling method.

this.Adapter.SelectCommand =this.CommandCollection[0];
TasksDataSet.intranet_addressesDataTable dataTable =new TasksDataSet.intranet_addressesDataTable();
try{this.Adapter.Fill(dataTable);
}
catch(ConstraintException ce)
{
throw new ConstraintException(ConstraintExceptionToString(ce,dataTable),ce);
}
return dataTable;
}

public static string ConstraintExceptionToString(ConstraintException ce, DataTable dt)
{
return"Constraint Exception [" + ce.Message +"] in " + dt.TableName +" (" + dt.Rows.Count +" rows)\n" +
DataTableErrorsToString(dt);
}

public static string DataTableErrorsToString(DataTable dt)
{
StringBuilder sb =new StringBuilder();
for (int x=0; x < dt.Rows.Count; x++)
{
DataRow dr = dt.Rows[x];
if (dr.HasErrors)
{
sb.Append("\tError in row " + x +": " + dr.RowError +"\n");
}
}
return sb.ToString();
}


|||

Cheers Gunteman, I'll have to remember that for my future post! Ahem, one more question.

I am working with Visual Web Developer, and the files I am working with are...

index.aspx (holds the gridview and dataset information), The TaskDataSet.xsd and the database itself.
In which of the files in my Visual Web Developer do I place the above method, or do I open a class in VWD to place it into?

I did have a try implementing the above before posting, but still not sure where it goes...

I appreciate any more help you can pass my way :-)

|||

You would probably be better off using nvarchar(2048) than nvarchar(max). As far as I am aware, there isn't a defined limit, but most browsers (IE, etc.) won't handle more than that, and some proxies/security scanners won't allow more than 1024.

|||

Hi, thanks for the reply. I have updated it from MAX to 2048, so thats very cool to know.

But it hasnt fixed my problem with inserting the following address into my database:www.java-scripts.net/javascripts/Image-Rollover-Script.phtml

|||

jamesstar:

I did have a try implementing the above before posting, but still not sure where it goes...

I appreciate any more help you can pass my way :-)

If you look closely you''ll see that I've just continued from the portion of your code that was visible in the error message.

|||

Ah yes, I see now... :-D

Hmm, that code comes from a temporary App_Code (something).cs file within the framework.
So I gather even if I changed that one file, it wouldnt be permanent, I will do some further research and see if I can locate the hard copy of that file.

I thought you might be able to create a CS file inside the App_Code folder that could be shared across all files.

Okay, chat soon.

|||

Okay, after visiting a few more forums and hands in head. I started reading through each line in the error code and noticed the dataset code had not updated itself.

It was still referencing each column in the table with nvarchar(MAX), even though I had updated the database.

So I deleted my current dataset file and re-inserted it back in... and now, wonderfully enough... my aspx page works!

Yahhh ~ Thank you!!

*** Don't give up hope, just keep going forward ;-)

Wednesday, March 7, 2012

Error with Neural Network Viewer

I have read the threads regarding the Neural Network Viewer and I think I have a similar problem. I do have Service Pack 2 installed and I'm running the x64 version of SQL 2005.

I'm building a model from a single relational CASE table. Granted the table has many columns summarized at the customer level but there are it is well formed and has no NULL values (plenty of zero or blank values though). The only time I can get the NN Viewer to work is when I accept the attribute recommendations. It seems once I stray from these recommendation, even if there is still correlation with an attribute, I cannot view the model using the NN Viewer. My latest error message says:

"The provider could not determine the String value. For example, the row was just created, the default for the String column was not available, and the consumer had not yet set a new String value."

I get this message even when all input attributes are Continuous so I'm not sure what String column it is referring to.

Any help is greatly appreciated. I'm in a time crunch and I have sold the client on SQL Server 2005 capabilities. It's a bit embarrasing if I can't get this resolved.

-- Steve

P.S.: I don't recall having any issues with the NN Viewer prior to Service Pack 2 (although others have). Have you done regression testing to test this issue?

Hello,

Is it possible for you to export your model and send it to us? You can send to tatyanam "at" microsoft "dot" com.

Thanks,

Tatyana

|||

Hi Tatyana

Per our joint discovery, it appears that dates that are too far out into the future (e.g., 12/31/9999) are causing this problem. The solution is to either use earlier default dates (e.g., 12/31/2999) or discretize the date fields. This eliminates the specific NN Viewer problem I was experiencing.

Thanks.

Sunday, February 19, 2012

Error while setting up Replication

I am trying to set up replication from a remote server (YYYY) to a server
(XXXX) on my company's network. The remote server will be the publisher and
the local server will be the distributor and subscriber. It gives me the
following error when I configure the publisher and distributor :
SQL Server could not configure 'XXXX' as the Distributor for 'YYYY'.
Error 17: SQL Server does not exist or access denied.
I could log on as 'sa' to the remote server (YYYY) as well as the local
server (XXXX) via SQL Enterprise manager.
I know port #1433 is opened up. What other ports do I need to open up ? From
where ?
Please help
TIA
Mo
It might be a naming issue.
Try:
Use Master
go
Select @.@.Servername
This should return your current server name but if it
returns NULL then try:
Use Master
go
Sp_DropServer 'OldName'
GO
Use Master
go
Sp_Addserver 'NewName', 'local'
GO
Stop and Start SQL Services
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||You have to use the netbios names of the publisher and subscriber. Register
both in EM using the netbios names. Hide the fqdn (if you need to use it) by
using a server alias using Client Network Utility.
Have you set up an administrative link password? Disable this option to make
debugging simpler.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"MO" <MO@.discussions.microsoft.com> wrote in message
news:86384240-283C-42CA-A5A6-15647FDA34B8@.microsoft.com...
> I am trying to set up replication from a remote server (YYYY) to a server
> (XXXX) on my company's network. The remote server will be the publisher
and
> the local server will be the distributor and subscriber. It gives me the
> following error when I configure the publisher and distributor :
> SQL Server could not configure 'XXXX' as the Distributor for 'YYYY'.
> Error 17: SQL Server does not exist or access denied.
> I could log on as 'sa' to the remote server (YYYY) as well as the local
> server (XXXX) via SQL Enterprise manager.
> I know port #1433 is opened up. What other ports do I need to open up ?
From
> where ?
> Please help
> TIA
> Mo
>
|||Thanks Paul for the quick reply. The sql instance name is say 'AAAA' and when
I run @.@.servername it returns 'AAAA'. The windows server name is say 'WWWW'.
TIA
MO
"Paul Ibison" wrote:

> It might be a naming issue.
> Try:
> Use Master
> go
> Select @.@.Servername
> This should return your current server name but if it
> returns NULL then try:
> Use Master
> go
> Sp_DropServer 'OldName'
> GO
> Use Master
> go
> Sp_Addserver 'NewName', 'local'
> GO
> Stop and Start SQL Services
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>
>
|||Some of the things you mentioned are above my head.
When you say netbios names of the publisher and subscriber you mean the
windows server name ? How do I know the netbios name ?
Hide the fqdn... What is fqdn ? and how do I hide it ?
TIA
MO
"Hilary Cotter" wrote:

> You have to use the netbios names of the publisher and subscriber. Register
> both in EM using the netbios names. Hide the fqdn (if you need to use it) by
> using a server alias using Client Network Utility.
> Have you set up an administrative link password? Disable this option to make
> debugging simpler.
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
> "MO" <MO@.discussions.microsoft.com> wrote in message
> news:86384240-283C-42CA-A5A6-15647FDA34B8@.microsoft.com...
> and
> From
>
>
|||do a master.dbo.xp_cmdshell 'echo %computername%' for the netbios name. This
should be the same as what you get when you issue a select @.@.servername
unless you have an instance.
Make sure that the results of the echo %computername% is the same as what
you registered your computer in EM as.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"MO" <MO@.discussions.microsoft.com> wrote in message
news:4F03827C-055A-4783-84D0-75FE44858D77@.microsoft.com...[vbcol=seagreen]
> Some of the things you mentioned are above my head.
> When you say netbios names of the publisher and subscriber you mean the
> windows server name ? How do I know the netbios name ?
> Hide the fqdn... What is fqdn ? and how do I hide it ?
> TIA
> MO
> "Hilary Cotter" wrote:
Register[vbcol=seagreen]
it) by[vbcol=seagreen]
make[vbcol=seagreen]
server[vbcol=seagreen]
publisher[vbcol=seagreen]
the[vbcol=seagreen]
local[vbcol=seagreen]
?[vbcol=seagreen]
|||Did you forget to run the rest of the script...
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)

Error while retrieving servers

I've tried to retrieve and fill a combobox with all my servers on my network, and the program tells me he doesn't found any servers, I've got three instances running (SRV-01,SRV-02,SRV-01\SQLEXPRESS), I really don't understand. So I use

SmoApplication.EnumAvailableSqlServers(true)

to test only on my local machine and no server found ?

Here is the code I used :

this.Cursor = Cursors.WaitCursor;

DataTable dtSqlServer = SmoApplication.EnumAvailableSqlServers(true);

foreach (DataRow drServer in dtSqlServer.Rows)

{

string sServer = drServer["Server"].ToString();

if (drServer["Instance"] != null && drServer["Instance"].ToString().Length > 0)

sServer += @."\" + drServer["Instance"].ToString();

if (listDataBases.Items.IndexOf(sServer) < 0)

listDataBases.Items.Add(sServer);

//Make the local server the default

Server local = new Server();

String serverName = local.Name;

if (local.InstanceName != null && local.InstanceName.Length > 0)

serverName += @."\" + local.InstanceName;

Int32 idx = listDataBases.FindStringExact(serverName);

if (idx >= 0)

listDataBases.SelectedIndex = idx;

this.Cursor = Cursors.Default;

}

Is someone can help me thanks, I use Win XP SP2, VS 2005 team suite, SQL Server 2005 std + SP1, SQL Server 2005 express + SP 1

PS : I've tried without EnumAvailableSqlServers using a simple textbox instead, and when I enter the name of my servers it works ?!!!

I've disabled SQL Server Browser now it see my local server but not my network instances and not my SQL Express instance ?|||Hi, I guess you are messing up with instance and server of the resultset of the enumaration of the server.

http://www.sqlserver2005.de/articles/1/

HTH, jens Suessmeyer.

http://www.sqlserver2005.de

Error while Replication

Hello,
1. I have made my database server as Publisher & Distributor for a
database. I have added another server into my network, and I have configured
that machine as the Subscriber using Wizard. So when I run the Publishing
Agent, it runs fine without any problem. But in the Subscriber machine, the
status shows 'Failed' and hence the data is not replicated. So, can anyone
suggest me, where I could have gone wrong during the process?
2. I had selected the 'Immediet Queuing' and 'Queue' methodology to
update the Subscriber. Is this enough to make the changes to replicate
immedietly on the Subscriber as soon as the data is changed in Publisher? I
want the subscriber to get updated as soon as the data in Publisher is
updated. Are the above options will help in doing this?
1) Double Click on the failed agent. What is the message in error details.
2) No, you need to change your polling interval on the log reader agent and
distribution agents to 1 s to get data updated on the Subcsriber near real
time. I think you will be looking at latencies under 20s
"Sheshadrinath R" <SheshadrinathR@.discussions.microsoft.com> wrote in
message news:6D5693DD-5ACC-4FDD-AB6B-1E46EF55B5E5@.microsoft.com...
> Hello,
> 1. I have made my database server as Publisher & Distributor for a
> database. I have added another server into my network, and I have
> configured
> that machine as the Subscriber using Wizard. So when I run the Publishing
> Agent, it runs fine without any problem. But in the Subscriber machine,
> the
> status shows 'Failed' and hence the data is not replicated. So, can anyone
> suggest me, where I could have gone wrong during the process?
> 2. I had selected the 'Immediet Queuing' and 'Queue' methodology to
> update the Subscriber. Is this enough to make the changes to replicate
> immedietly on the Subscriber as soon as the data is changed in Publisher?
> I
> want the subscriber to get updated as soon as the data in Publisher is
> updated. Are the above options will help in doing this?