473,386 Members | 1,736 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

PropertyGrid and SqlMetal generated classes

Hello,

I have used SqlMetal to generate the Dlinq classes for my database
schema. I have created instances of those classes and then tried
binding them to a PropertyGrid object through it's SelectedObject
property. Whenever a Dlinq object is bound, and a particular EntityRef
object within that class cannot be obtained from a query, it throws a
EmptySequenceException.

This is really not an issue from a "get" perspective, i.e. when an
object is bound to the PropertyGrid object. However, this becomes a
problem when you attempt to modify a property on the Dlinq object
through the PropertyGrid object. For example, if I try to change the
Name parameter to something else, if an EntityRef property cannot be
found, the PropertyGrid object displays the "Invalid Property Value"
dialog box detailing the exception I mentioned above and I can't leave
focus until I cancel. This is a problem, because I'm changing the
value on a Name property which shouldn't have anything to do with the
EntityRef property.

I have tried creating my own PropertyDescriptor class that catches a
TargetInvocationException object who's inner exception is the
EmptySequenceException object in an override of the SetValue method.
This stops the "Invalid Property Value" dialog box from displaying.
However, the Name property reverts back to its original on leaving
focus.

So, it appears to me that a set of unrelated class members are
preventing a particular property on the class from being set when it
shouldn't be.

Hammad

Apr 21 '06 #1
0 1204

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

Similar topics

6
by: Terry | last post by:
I have a very basic program, but for some reason I can't get it to behave properly. What I want is a basic form with a TabControl that fills the entire form. The tab control should have 4 tabs...
2
by: Mevar81 | last post by:
Hi to everybody.I have a problem with the PropertyGrid control.I want to display not all the properties of a generic Control(Button,TextBox,ComboBox,ecc.).In general I don't want to display only...
1
by: ANDRES BECERRA | last post by:
Herfried K. Wagner was kind enough to point me to the PropertyGrid control http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemwindowsformspropertygridclasstopic.asp I have found a few...
4
by: phcmi | last post by:
I have a PropertyGrid question. My task is to replace a legacy dialog box presentation with a modern one. The dialog itself allows the user to set configuration settings in our application, so...
0
by: Robson Felix | last post by:
Folks, I've been trying to put some legacy databases I have here through SqlMetal. Most of it goes well, but in some stored procedures, I get errors for temp tables that don't exist and so on. I...
0
by: Andrus | last post by:
I use sqlmetal to generate cs code. sql metal generates property attributes in form public string Floorlimit { .... I need to specify that this property is discriminator. Since C# does not...
3
by: Andy | last post by:
Hi, I use procs for my data access, instead of allowing direct inserts and updates to tables. How can I get SqlMetal to generate code that will use procs? I know the designer you can Configure...
0
by: Joern Schou-Rode | last post by:
In the database (SQL2005) that I am working on, the tables are divided into a few schemas, which are used to restrict permissions for certain users. When autogenerating entity classes thorugh the...
2
by: Big Daddy | last post by:
For example, if I have a DB table called DownloadPoints with a column named DownloadPointNo, then SqlMetal will create a file with a class called DownloadPoints with an accessor named...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...

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.