Strongly Typed DataSet -> Preview Data -> How to preview stored procedures with GUID parameter?

M

Max2006

Hi,

In Strongly typed datasets, when we preview a table adapter query, we cannot
preview a stored procedure query that has GUID parameter.

The error complains that cannot convert a string to GUID.

What is the proper format for GUID parameters? Of course I tried {.} format.

Thanks,
Max
 
W

WenYuan Wang [MSFT]

Hello Max,

For Strongly Typed Dataset, the DBDataAdapter has been wrapped by
TableAdapter class which generated by VS 2005 IDE. I assume the typed
dataset created by VS 2005. Please correct me if I misunderstand.

TableAdapter will define all the parameter for DBCommand which used for
executing Stored Procedure.
The type of each parameter in DBCommand should be the same the type as it
in Stored Procedure.
Otherwise, the error message will show up when we preview/execute the
DBCommand.
For OleDB, the type is System.Data.OleDb.OleDbType.Guid.
this._adapter.UpdateCommand.Parameters.Add(new
System.Data.OleDb.OleDbParameter("GID", System.Data.OleDb.OleDbType.Guid,
0, System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), " GID",
System.Data.DataRowVersion.Current, false, null));

For SQL Database, the type is System.Data.SqlDbType.UniqueIdentifier.

I guess the parameter has been defined as the wrong type.

In order to resolve the issue, we need more detailed information. Would you
please clarify the following question for me? Thanks.
1) Which Database is your application connects to? (SQL database or Access
file?)
2) What is the Store Procedure in the underlying database? (Could you paste
the source code of Store Procedure here? This will be helpful very much)
3) Does the typed Dataset's generated by VS 2005 IDE? If true, would you
please send me the DataSet.Designer.cs file? I will review on this. If
Typed Dataset created by yourself, would you please paste the code about
the DBCommand and each DBCommand's Parameter.
My alias is (e-mail address removed). I'm looking forward to your reply.

Have a great day.
Sincerely,
Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
W

WenYuan Wang [MSFT]

Hello Max,

This is Wen Yuan. I just want to check if you have resolved the issue so
far?
If it still persists, would you please collect some detailed information as
my former post and update here again? We will perform more research on
this. I'm glad to work with you.

Have a great day,
Sincerely,
Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
M

Max2006

Hi Wen,

Thanks for follwo-up. My question was realted to visual studio dataset
designer UI. When you preview a stored procedure, the VS.NET UI does not
allow you to enter a GUID value.

Regards,
Max
 
W

WenYuan Wang [MSFT]

Hello Max,
Thanks for your reply.

I'm sorry to say this is VS 2005 IDE product issue.

I have repro the issue today. The issue occurs in VS.net 2005 DataSet
Desiginer UI. However, at runtime when I pass a Guid to the table adapter,
it works fine.

https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?Feedba
ckID=237974
[Preview Data Dialog does not accept GUIDs]
Young (Program Manager) confirmed this issue. It seems they will reconsider
this issue when planning for the future releases. (After Orcas)

We are indeed sorry for any inconvenience this may have caused.
Best regards,
Wen Yuan
Microsoft Online Community Support
=================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 

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