[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.odbcnet

SqlException in Visual Studio 2005

ComputerGuyCJ

2/2/2006 12:45:00 AM

First of all, I apologize if I'm not posting this in the appropriate group.
This is my first time using these Newsgroups, so I'm trying to find my way
around. That said, this is my problem:

I have a stored procedure I'm calling from Visual Studio 2005. The query
works just fine in query analyzer, but returns a very generic error in VS.
Here's my stored procedure:

CREATE PROCEDURE [dbo].[prc_AssetChangeVendorDetailID]
@OldVendorDetailID int,
@NewVendorDetailID int
AS
SET NOCOUNT ON

UPDATE [Asset]
SET

[VendorDetailID] = @NewVendorDetailID
WHERE
[VendorDetailID] = @OldVendorDetailID

and the code that calls it is:

//Update all asset records with the old vendor detail ID to new ID.
cmd = new SqlCommand();
cmd.Connection = conn;
cmd.Parameters.AddWithValue("@OldVendorDetailID", 1);
cmd.Parameters.AddWithValue("@NewVendorDetailID", 2);
cmd.CommandText = "[prc_AssetChangeVendorDetailID]";
cmd.ExecuteNonQuery()

I get an exception with the message of "Line 1: Incorrect syntax near
'prc_AssetChangeVendorDetailID'." Normally, I wouldn't argue with the editor,
but the fact that the procedure executes without a problem in query analyzer
is what has me stumped.

Is there something I'm doing wrong?
4 Answers

Jim Hughes

3/31/2006 10:14:00 PM

0

add cmd.CommandType = CommandType.StoredProcedure; before ExecuteNonQuery

"ComputerGuyCJ" <ComputerGuyCJ@discussions.microsoft.com> wrote in message
news:6FC34BDF-7F32-4D1E-A7F8-70D470E64828@microsoft.com...
> First of all, I apologize if I''m not posting this in the appropriate
> group.
> This is my first time using these Newsgroups, so I''m trying to find my way
> around. That said, this is my problem:
>
> I have a stored procedure I''m calling from Visual Studio 2005. The query
> works just fine in query analyzer, but returns a very generic error in VS.
> Here''s my stored procedure:
>
> CREATE PROCEDURE [dbo].[prc_AssetChangeVendorDetailID]
> @OldVendorDetailID int,
> @NewVendorDetailID int
> AS
> SET NOCOUNT ON
>
> UPDATE [Asset]
> SET
>
> [VendorDetailID] = @NewVendorDetailID
> WHERE
> [VendorDetailID] = @OldVendorDetailID
>
> and the code that calls it is:
>
> //Update all asset records with the old vendor detail ID to new ID.
> cmd = new SqlCommand();
> cmd.Connection = conn;
> cmd.Parameters.AddWithValue("@OldVendorDetailID", 1);
> cmd.Parameters.AddWithValue("@NewVendorDetailID", 2);
> cmd.CommandText = "[prc_AssetChangeVendorDetailID]";
> cmd.ExecuteNonQuery()
>
> I get an exception with the message of "Line 1: Incorrect syntax near
> ''prc_AssetChangeVendorDetailID''." Normally, I wouldn''t argue with the
> editor,
> but the fact that the procedure executes without a problem in query
> analyzer
> is what has me stumped.
>
> Is there something I''m doing wrong?


Jeff Lait

2/20/2008 4:23:00 PM

0

On Feb 20, 3:31 am, "Ulf Åström" <ulf.ast...@gmail.com> wrote:
>
> I also dislike most translations. This is an area amateurs should
> really stay away from; they do more harm than good. Literature isn't
> so bad, it's done by professionals that get the *meaning* of the text
> right, even if the end result is less vivid than the original. OTOH
> software, webpages and "fan-subbed" movies make me cringe; they tend
> to be translated word-by-word, resulting in a very mangled and awkward
> language.

I have found the opposite. Fan-subbed anime can be better than the
official English dub. This may be because they are sticking closer to
the original words so result in less dissonance with the spoken
Japanese. This might be the exception that proves the rule, however.
I have certainly seen a few subs which I could improve by rewriting
the text in real time. The problem, I don't think, is the word-by-
word translation. It is the absence of a destination-language native
editor.

One of my great and future goals for POWDER is to support multiple
languages natively. As bad as the initial translations might be, I
think there is a tendency to underestimate just how much accessibility
can be created by even a poor translation. Given a choice between
awkward and mangled and none-at-all, I might pick awkward and
mangled. OTOH, such a choice is missing the opportunity to learn a
language in the best way - by necessity.
--
Jeff Lait
(POWDER: http://www.zincland....)

Ulf Åström

2/21/2008 8:16:00 AM

0

On 20 Feb, 20:22, Patric Mueller <bh...@bigfoot.com> wrote:
> "Ulf Åström" <ulf.ast...@gmail.com> wrote:
>
> > An observation though: many (most?) RL developers who aren't native
> > english speakers [...]
>
> My impression also is that there are a lot more non English RL
> developer. I don't know why as well.

Perhaps because most world residents are non-english? :-)

> > Literature isn't
> > so bad, it's done by professionals that get the *meaning* of the text
> > right, even if the end result is less vivid than the original. OTOH
> > software, webpages and "fan-subbed" movies make me cringe; they tend
> > to be translated word-by-word, resulting in a very mangled and awkward
> > language.
>
> Is it really that bad with Swedish?

Swedish translations aren't *useless*, but still bad enough for me to
prefer the original english. I guess most of it is ok, but there is a
stiff and formal tone to it that constantly reminds me I'm only
reading a translation, not an original text. OTOH, I have above-
average english skills (for being swedish) so perhaps I'm just
splitting hairs.

> I can't say the same about German. Translated software and webpages
> are quite readable (of course only if they are not translated by a
> program[1]) and if they belong to an OSS project the translations are
> usually very good or are quickly improved.

Sweden has 9 million residents, Germany 82 million. The number of
potential translators ought to be ninefold as well, while the amount
of text that needs to be translated remains the same.

-the ru

Ulf Åström

2/21/2008 8:40:00 AM

0

On 20 Feb, 17:22, Jeff Lait <torespondisfut...@hotmail.com> wrote:
> On Feb 20, 3:31 am, "Ulf Åström" <ulf.ast...@gmail.com> wrote:
>
> > I also dislike most translations. This is an area amateurs should
> > really stay away from; they do more harm than good. Literature isn't
> > so bad, it's done by professionals that get the *meaning* of the text
> > right, even if the end result is less vivid than the original. OTOH
> > software, webpages and "fan-subbed" movies make me cringe; they tend
> > to be translated word-by-word, resulting in a very mangled and awkward
> > language.
>
> I have found the opposite.  Fan-subbed anime can be better than the
> official English dub.  This may be because they are sticking closer to
> the original words so result in less dissonance with the spoken
> Japanese.  This might be the exception that proves the rule, however.
> I have certainly seen a few subs which I could improve by rewriting
> the text in real time.  The problem, I don't think, is the word-by-
> word translation.  It is the absence of a destination-language native
> editor.

I watch fan-subbed anime, but since I don't know japanese it's hard to
tell how accurate it is. :-)

I was mostly thinking of english to swedish translations, perhaps I
should have made this clearer. The mistakes I spot are too subtle to
discuss unless you know both languages well, so I won't go into
details here. An obvious example though is a (fan-subbed) movie I saw
recently where they had translated "forfeit" to "win"...

Perhaps I should attempt a career as a translator.

-the ru