473,473 Members | 2,036 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

GUID key fields and GridView/DetailView

After working on this for the past three days!!

1. I build a simple table in sql server 2005
TestID (int, auto increment) (key)
TestText (nvchar,10)

2. In visual studio 2005, I build a simple dataset, using one tableadapter
based on the test table, select both fields, and use the wizard to build the
get, update,insert, delete queries.

3. save and compile

4. build a new web page, default.aspx

5. add an objectdatasource based on the table adapter above

6. add a GridView and link to the objectdatasource above

7. Save and compile

8. run

9. It works!!!!

10. Repeat all of the steps above with the ONLY difference that I set the
key field (testID) to a replication type (GUID).

IT FAILS with the error:

"Could not find a property named 'TestText' on the type specified by the
DataObjectTypeName property in ObjectDataSource 'ObjectDataSource1'"

Question: Am I the only one that can't figure out why this is happening?

What is going on here?

It would appear that the Gridview does not properly handle the GUID object
and I might need to do some string-->guid and/or guid--string conversion.

My problem is that I don't know where to do this (maybe in the onupdating
event)

The only work around I have found is to capture the returned values manually
in the onupdating event of the GridView and manually pushing the data around.
This goes against the grain of the IDE concept.

Note: Changing the key type in my production database is just not an option!

Ideas, experience -- please!!
--
Ed Warren
Apr 16 '07 #1
0 1035

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jiho Han | last post by:
I generated a class from a schema. One of the fields are typed as System.Guid. Perfect. The only problem is when this class serializes, the guid field serializes as...
8
by: Steve Jorgensen | last post by:
So far, I have never chosen to use GUIDs as Autonumer keys for the tables in my projects, but a recent experience has got me to wondering. I have recently been working on a system that, during...
0
by: Kha Tran | last post by:
Please give me a sample of using xpo objectdatasource gridview detailview for select,insert,update and delete Thanks -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
0
by: Mike | last post by:
I have a detailview, with several template columns in it. It's setup so that a user views info from a datagrid, and if they want to add another row, they click a button. The button causes a...
0
by: rockdale | last post by:
Hi, I have a web page which let user data enter employee working hours. I used datagrid to list all the employee and templateColumn to format the workhours column to textbox for data entry. And...
8
by: Leon_Amirreza | last post by:
I have a column named "ID" and its type is "uniqueidentifier" in SQL Server 2005 Express. this column is the primary key and its default value is "newid()" in SQL Server. I have generated a...
0
by: =?Utf-8?B?THVib21pcg==?= | last post by:
Hi, I have a GridView and Dataview controls. If user clicks on a row in GridView, the details will be shown in DetailView. 1/ I want to show in DetalView only details field - without column...
0
by: Deepak Palkar | last post by:
Hi I have Gridview and DetailView both on one page. I am showing the list in the Gridview and the particular record in DetailView. the problem is When i EDIT on the DetailView and try to UPDATE...
1
by: Plissskin | last post by:
I would like to put radio buttons (check boxes, drop down lists) in an ItemTemplate field and have them disabled so the user is not confused. However, I do not like simply disabling the controls...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.