473,769 Members | 5,878 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
EmptySequenceEx ception.

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 PropertyDescrip tor class that catches a
TargetInvocatio nException object who's inner exception is the
EmptySequenceEx ception 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 1223

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

Similar topics

6
2900
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 with a single PropertyGrid control on each tab that fills it's parent's tab page's client area. Here's what I did. 1. Create a new project.
2
3982
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 one category(Appearance, Behavior,ecc.) but I want to chose directly which properties to show.I've read that I can use the SelectedObjects to put an array of object with some properties in common with the SelectedObject,and only properties in...
1
11886
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 samples of how to use the PropertyGrid control and have gained a decent understanding of it. But of course, as it usually the case, my needs go far beyond the simple examples shown in online samples. All the online samples show how to take a class...
4
18822
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 it seems to me that a PropertyGrid is a perfect modern replacement. I won't bore you with the details with all the controls on the dialog since I'm only concerned with one issue. The legacy dialog contains a drop down list control that is...
0
1031
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 don't think I can simply go and change every single object of mine. My question is: is there a way to have SqlMetal generate a dataset for each stored procedure call rather than a customized result for each procedure? I understand that...
0
905
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 support partial properties, I added manually to generated code
3
1961
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 Behavior to do this.. is there no equivolent in Sql Metal? Thanks
0
937
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 SqlMetal command line tool, the schema names become part of the class names (eg. a class might be named Schema_Table). Searching the internet for this subject does not turn up much - just a single forum post with an answer like "this is the way...
2
10194
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 DownloadPointNo. I would like the object to be able to pass me the string "DownloadPointNo". For example, the code could be something like: DownloadPoints dp = new DownloadPoints(); string colName = dp.DownloadPointNo.ColumnName; Or I could write a...
0
9423
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10049
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9996
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9865
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7410
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6674
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5307
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3964
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3564
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.