473,554 Members | 2,946 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 4340
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
4189
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
9663
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...
2
6719
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
2718
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
3424
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...
9
5038
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
4731
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...
0
945
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...
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
7497
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...
0
7780
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8010
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...
1
7530
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...
1
5414
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...
0
5136
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...
0
3539
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...
1
1994
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
1
1111
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.