Showing posts with label website. Show all posts
Showing posts with label website. Show all posts

Tuesday, March 27, 2012

Error: Column Name "X" appears more than once in the result column list.

Hello,

I am trying to follow along with the Data Access tutorial under the the "Learn->Videos" section of this website, however I am running into an error when I try to use the "Edit -> Update" function of the Details View form:

I'll post the error below. Any clues on how to fix this? Thanks in advance!!!

~Derrick

Column name 'Assigned_To' appears more than once in the result column list.

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: Column name 'Assigned_To' appears more than once in the result column list.

Source Error:

Line 1444: }Line 1445: try {Line 1446: int returnValue = this.Adapter.UpdateCommand.ExecuteNonQuery();Line 1447: return returnValue;Line 1448: }

What does your UPDATE command look like?|||

Thanks for the reply. When I go to my Details.aspx page (the page giving me the error), I click on the Details View Control -> Configure Data Source, Click the Update Tab, and here is the Method Signature:

Update(String Assigned_To, String Request_type, String First_Name, String Last_Name, String Username, Nullable Created_On, String Request_Summary, String Expr1, Int16 Original_Request_Id), returns Int32

Does this help?

|||

I was able to resolve this issue. It had to do with the "String Expr1" part of the Update function. I removed any reference to Expr1 from all my data sets, refreshed the schemes in the web forms, and everything worked as it should.

Thanks for anyone who looked into it!

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

error: 26 - Error Locating Server/Instance Specified

Hi

I have setup the membership schema on a hosted server using the asp_regsql.exe tool fine. I have setup roles/memberships using the website adminitraion tool and i have checked that its all being entered into my hosted MSSQL server. I have also setup my web.config file to point to the hosted server and all seems to be connecting ok! When i test/debug my project locally (using the F5 key), my login box works fine!

How ever, i have now uploaded my project to my hosted server. If i put an incorrect login, then i get the usual 'Your login attempt was not successful. Please try again.' - So i know its connecting to the right database. How ever, when i enter the correct login details, i get the following error:

An error has occurred while establishing a connection tothe server. When connecting to SQL Server 2005, this failure may becaused by the fact that under the default settings SQL Server does notallow remote connections. (provider: SQL Network Interfaces, error: 26- Error Locating Server/Instance Specified)

...if its connecting to the same database fine when i test it from my local machine, why will it not work when i test it from my hosted server?

thanks

Hi

I've got it working now, how ever the problem seems to be somthing to with trying to access a page which is not in the root. I placed a new folder called 'admin' into my root folder. Inside the admin folder i placed a login.aspx and a default.aspx page.

In my web.config i placed:

<authentication mode="Forms">
<forms loginUrl="4dm1n/login.aspx" />
</authentication>

When logging on using this folder system is when the error occurs!

Any ideas what i need to change in order to get the scope right?

|||

found the problem - I hadn't declared the roleManager provider, eg

<roleManager enabled="true" defaultProvider="CustomizedRoleProvider">
<providers>
<add name="CustomizedRoleProvider"
type="System.Web.Security.SqlRoleProvider"
connectionStringName="BVDB" />
</providers>
</roleManager>

duh!