Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
|
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 20th, 2006, 09:24 PM
Friend of Wrox
 
Join Date: Apr 2005
Posts: 190
Thanks: 0
Thanked 0 Times in 0 Posts
Default Need help on MS SQL Server 005 Express INSERT cmd

Help Please:

I'm writing a web service which does an insert into an MS SQL 2005 Express table.

Let's say I have a table named Activities, with an index field named ActivityIndex as: bigint, PK, not null, that is autoincrement. It is autoincrement because I have the Identity increment and Identity seed = 1 and Identity = Yes.

And lets say that there is one more field in table named Leader which is varchar50.

My insert statement is: INSERT INTO Activities (Leader) VALUES ('Tom')

This is failing and I don't know why. I should not have to specify a
value for an autoincrement field, right?

Error msg is:
Message = "System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.ArgumentException: Keyword not supported: 'id'.
   at System.Data.Common.DbConnectionOptions.ParseIntern al(Hashtable parsetable, String connectionString, Boolean...

I don't have anything with an attribute or value named 'id'.

Anyone help me out here? Thanks.

Victor Victor

 
Old November 20th, 2006, 09:41 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
Default

I think there is a problem with your connection string. can you post that.

======================================
They say, best men are molded out of faults,
And, for the most, become much more the better
For being a little bad.
======================================
 
Old November 20th, 2006, 11:01 PM
Friend of Wrox
 
Join Date: Apr 2005
Posts: 190
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Rod:
Thanks for the reply. Sure on the connection string. It is:

  <connectionStrings>
    <remove name="RemoteFTADatabase"/>
    <add name="RemoteFTADatabase" connectionString="server=208.48.137.190;Database=F TA;User ID=Ted;Password=xxxxx;Trusted_Connection=False"/>
  </connectionStrings>

I was about to add an addition to my initial problem statement which is, the web service works when I use the built-in test page in VS 2005. Its only when I try to consume the web service in a separate app that it fails. I am using the identical connection string in both.

The password xxxxx above is not the real one, but except for that, its identical.

VV




 
Old November 20th, 2006, 11:15 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
Default

The connection string looks fine, are you publishing the web service to IIS for the app to use. or are you running it in development web server


======================================
They say, best men are molded out of faults,
And, for the most, become much more the better
For being a little bad.
======================================
 
Old November 20th, 2006, 11:19 PM
Friend of Wrox
 
Join Date: Apr 2005
Posts: 190
Thanks: 0
Thanked 0 Times in 0 Posts
Default

First things first. I'm running it on my development provider's site.

 
Old November 22nd, 2006, 11:42 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Sorry mate, been away, how have you gone?
The connection string and SQL looks ok to me.
is the schema you are passing the same for both web service calls.
Compare the wsdl's generated by referencing the web service in your apps.
See if there is a difference that might indicate a different schema.
Try Update web reference in your client app that is failing.
Try and provide a little more info if possible.
Failing that:
I recommend Soap Scope by Mindreef for diagnosing web service issues.
I beleive there is a trial available for soapscope.
 http://mindreef.com/products/soapscope/index.php


======================================
They say, best men are molded out of faults,
And, for the most, become much more the better
For being a little bad.
======================================
 
Old November 23rd, 2006, 12:38 AM
Friend of Wrox
 
Join Date: Apr 2005
Posts: 190
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Rod:
Thanks for the reply (and help). I have solved the problem.
Your last suggestion to check the schema also lead me to check the names of the connection strings. In the project to define the web service I had one name in the collection of connections in web.config. In the consuming app I thought I had specified the same name, but it was slightly off but looked similar. I changed the two names to exactly match and there in now joy in the Victor house.
So, Thanks again.

Victor Victor

 
Old November 23rd, 2006, 02:12 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
Default

:D

======================================
They say, best men are molded out of faults,
And, for the most, become much more the better
For being a little bad.
======================================





Similar Threads
Thread Thread Starter Forum Replies Last Post
Dashes in the server name , cannot run sql cmd combo SQL Server 2000 6 June 20th, 2014 02:02 AM
insert Arabic text to sql express 2005 abdrabaa SQL Server 2005 1 August 18th, 2007 05:45 PM
insert & update statment problem (sql express) abdrabaa C# 2 July 15th, 2007 05:54 AM
VB Express and SQL server on remote server questio HoosierDaddy61 Visual Basic 2005 Basics 0 February 22nd, 2006 11:27 AM
Accessing a SQL Server Express DB thru VB Express djelavic SQL Server 2005 2 February 21st, 2006 07:53 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.