PC Review


Reply
 
 
Aleksey Timonin
Guest
Posts: n/a
 
      18th Jan 2008
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


 
Reply With Quote
 
 
 
 
Cor Ligthert[MVP]
Guest
Posts: n/a
 
      19th Jan 2008
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

"Aleksey Timonin" <(E-Mail Removed)> schreef in bericht
news:%(E-Mail Removed)...
> 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
>


 
Reply With Quote
 
Aleksey Timonin
Guest
Posts: n/a
 
      19th Jan 2008
"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...

"Cor Ligthert[MVP]" <(E-Mail Removed)> wrote in message
news:BBD77EF1-C89D-482A-A2D6-(E-Mail Removed)...
> 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
>
> "Aleksey Timonin" <(E-Mail Removed)> schreef in bericht
> news:%(E-Mail Removed)...
>> 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
>>

>



 
Reply With Quote
 
Cor Ligthert[MVP]
Guest
Posts: n/a
 
      19th Jan 2008
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

 
Reply With Quote
 
Aleksey Timonin
Guest
Posts: n/a
 
      19th Jan 2008
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

"Cor Ligthert[MVP]" <(E-Mail Removed)> wrote in message
news:7E89D589-64CC-4618-AEAA-(E-Mail Removed)...
> 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
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to cast object of type 'System.Data.DataSet' to Typed DataSet Optimus Microsoft VB .NET 1 31st Jan 2006 06:26 AM
Ccopying a datatable content from an untyped dataset into a table which is inside a typed dataset Nedu N Microsoft ADO .NET 7 9th Dec 2003 02:50 PM
copying a datatable content from an untyped dataset into a table which is inside a typed dataset Nedu N Microsoft ADO .NET 2 31st Oct 2003 01:05 PM
copying a datatable content from an untyped dataset into a table which is inside a typed dataset Nedu N Microsoft ASP .NET 2 31st Oct 2003 01:05 PM
Ccopying a datatable content from an untyped dataset into a table which is inside a typed dataset Nedu N Microsoft ASP .NET 2 31st Oct 2003 02:42 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:56 AM.