Dataset bug

A

Aleksey Timonin

Hi guys,
I'm using Dataset in my project. In design time I configure TableAdapter in
the Dataset and set to the adapter as an Insert query following sql:

INSERT INTO UserInterface.ViewFields
(createdBy, createdOn, modifiedBy, modifiedOn, viewId,
fieldId, logicalFieldName)
SELECT @currUserId, GETUTCDATE(), @currUserId, GETUTCDATE(), @viewID,
fld.id, clmn.name
FROM UserInterface.Fields AS fld INNER JOIN
DBMetaData.Columns AS clmn ON fld.columnId = clmn.id
WHERE (clmn.tableId = @tableID)

The problem is that the method automaticaly generated by VS for this only
sql (with others I don't have such a problem) has no parameters!!! I was
more confused, when by click on "Query Builder..." -> "Execute Query" in
"TableAdapter Query Configuration Wizard" VS asked me to enter these
params!!!
Does anybody know about the bug, and know how can I resolve it?

Thanks a lot
Aleksey
 
C

Cor Ligthert[MVP]

Akeksey

Will you show us how this is automaticly generated by you. Visual Studio has
more methods therefore:
What version of VS and how did you do it,

For the rest are you sure that this is the used SQL string and not the part
that is set in the DataAdapter and then concatinated with the part for the
Update, in fact use the Update and the Insert the same parameters.

Cor
 
A

Aleksey Timonin

"how this is automaticly generated by you."
Not by me, by VisualStudio. After you add to adapter a new query via wizard
in design time, VisualStudio adds new method to the adapter with params
according to required sql params.
I'm using VS 2005.
"are you sure that this is the used SQL string and not the part "
Yes I'm sure.

I think I know what is the problem. Under select I have value params
@currUserId and @viewID. So VS don't recognize their type and couldn't add
them automaticaly...
I have such a problem only if I insert new values from another table (using
select). In case of regular insert with "INSERT INTO .... VALUES(....)"
syntax it works perfect.
Your advice...
 
C

Cor Ligthert[MVP]

Aleksey,

Are you really thinking you are the first one using Visual Studio 2005 in
the world?

You are doing probably something wrong, however don't call that a dataset
bug here, because then is helping almost impossible because you are sure it
is not your mistake.

Cor
 
A

Aleksey Timonin

Cor,
Don't call me a stupid. I suppose that I'm doing something wrong, but check
your self that it works (or not) you and give me idea what could be a
problem on my side. Of course in case you realy want to help.

Excuse me for my sharp tone. But I want to resolve the problem, and all I
get here just is everyone telling me that I do something wrong... It doesn't
help...

Best regards,
Aleksey
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top