473,725 Members | 2,264 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Type.GetType("S ystem.Drawing.P oint")) error...

I'm building a dataset that writes out a Point type value.
Here's the code that I've got:

1 Dim dsContent As DataSet = New DataSet("conten t")
2 Dim dtAsset As DataTable = New DataTable("asse t")
3 Dim dcPk(0) As DataColumn
4 dcPk(0) = _
5 dtAsset.Columns .Add("fullName" , Type.GetType("S ystem.String"))
6 dtAsset.Columns .Add("videoLoca tion",
Type.GetType("S ystem.Drawing.P oint"))
7 dtAsset.Columns .Add("videoSize ", Type.GetType("S ystem.Drawing.S ize"))
8 dtAsset.Primary Key = dcPk 'define primary key for this table
9 dsContent.Table s.Add(dtAsset)

The code compiles just fine but always blows up on line #6 stating:

An unhandled exception of type 'System.Argumen tNullException'
occurred in system.data.dll
Additional information: 'dataType' argument cannot be null.

How any idea what the problem is here and how to correct it?
Jan 25 '06 #1
5 4365
By default Type.GetType searched for requested type in mscorlib and in
executing assembly. You have to provide assembly qualified type name,
like

Type.GetType("S ystem.Drawing.P oint, System.Drawing, Version=2.0.0.0 ,
Culture=neutral , PublicKeyToken= b03f5f7f11d50a3 a")

Jan 25 '06 #2
How any idea what the problem is here and how to correct it?


The problem is that you have to specify the fully qualified type name
which includes the assembly name.

If you have a reference to System.Drawing. dll use the GetType operator
instead.

dtAsset.Columns .Add("videoSize ", GetType(System. Drawing.Size))
Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Jan 25 '06 #3
Thanks that seems to work for me... where can I find the fully qualified type
name for other types... (like Size, etc.)...

"Vladimir Matveev" wrote:
By default Type.GetType searched for requested type in mscorlib and in
executing assembly. You have to provide assembly qualified type name,
like

Type.GetType("S ystem.Drawing.P oint, System.Drawing, Version=2.0.0.0 ,
Culture=neutral , PublicKeyToken= b03f5f7f11d50a3 a")

Jan 25 '06 #4
if you have references to assemblies where these types are located, it
will be easier to use typeof() operator

Jan 25 '06 #5
Nope, I don't have refs to the assemblies where these types are located...

Is there an easy way to obtain/determine the fully qualified type name for a
specified type (i.e. Point, Size, etc.)

Thanks for your help!

"Vladimir Matveev" wrote:
if you have references to assemblies where these types are located, it
will be easier to use typeof() operator

Jan 25 '06 #6

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

Similar topics

1
4201
by: A | last post by:
Hi, I created an array of user defined objects dynamically in a class Foo's constructor. class Foo{ Foo(){ Bar* b = new Bar(); }
0
386
by: Supra | last post by:
: error BC30311: Value of type 'System.Drawing.Color' cannot be converted to 'Integer'. Function doColor(ByVal rtb As RichTextBox, ByVal a As String, Optional ByVal f As Integer = 0, Optional ByVal bg As Integer = 0) Dim b As String, n, fgcolor, bgcolor As Integer Dim colour(15) As Color colour(0) = Color.White colour(1) = Color.Black
6
9678
by: Raquel | last post by:
This is the scenario: We have DB2 Connect EE V8.1 installed on Sun sever. On my Windows PC, I have DB2 UDB PE 8.1 installed (Expiry date "Permanent"). When I try to access z/OS data using type 2 driver through a Java program on my PC, works fine. However, when I try to access z/OS data using type 4 driver through a Java program on my PC, it gives a message:
2
6735
by: Patrick Olurotimi Ige | last post by:
When i convert:- this code from VB to C# Why do i get error "Cannot implicitly convert type 'object' to 'bool' VB --- If cmdcommand.Parameters("ReturnValue").Value = 1 Then lblStatus.Text = "Username already exists!" Else lblStatus.Text = "Success!"
0
2724
by: Ganesh Muthuvelu | last post by:
Hello, What is wrong with this simple schema. When I try to load it to a dataset it gives me an error, "Data type not defined" Thanks. ****************************** <?xml version="1.0" encoding="utf-8"?> <xs:schema xmlns:tns="http://tempuri.org" targetNamespace="http://tempuri.org"
10
3441
by: James Stroud | last post by:
Hello All, I'm looking for a program to do line-drawings in 3d, with output to postscript or svg or pdf, etc. I would like to describe a scene with certain 1-3d elements oriented in 3d space with dashed or colored lines and filled or transparent surfaces (or maybe semitransparent). I would then like to set the camera and have the scene depicted as a line drawing (not ray-traced solid body, etc).
9
5052
by: Eric | last post by:
Hi Everyone, I'm writing a UserControl that exposes a property of the type System.Drawing.Image, like this: Public Property DefaultImage() As Image Get Return propDefaultImage End Get Set(ByVal Value As Image)
4
4741
by: freeflytim | last post by:
I'm trying to implement a custom MembershipProvider (and RoleProvider) together with a custom MembershipUser class in C#, Asp.Net 2.0, MS Visual Studio 2005. Everything has worked fine so far, all compiles, then I try to run the Website administration tool (WAT). I can bring up the main web page of the tool, but as soon as I click on 'Security', I get this error: Type is not resolved for member 'TC.Providers.TCMembershipUser,TC,...
0
949
by: Manuel | last post by:
Hi to all I'm using System.Drawing.Image for drawing in a web application, in local work fine for all value, when I put the my application on the server I get this error for big value: Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ArgumentException: Parameter...
6
621
by: James Hahn | last post by:
That looks like proper Property set code to me. What is the line of code that the designer is generating in the Sub InitializeComponent for a color that you select in the Properties Settings? "Nathan Sokalski" <njsokalski@hotmail.comwrote in message news:er%23hyAFOJHA.1896@TK2MSFTNGP02.phx.gbl...
0
8889
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8752
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
9257
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...
0
9116
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
6702
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
4519
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...
0
4784
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3228
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
2637
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.