473,698 Members | 2,047 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 4362
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
4200
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
9676
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
6731
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
2723
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
3439
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
5049
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
4739
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
948
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
8674
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
8603
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
9026
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
8893
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
8861
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...
0
7723
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5860
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
4366
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...
2
2328
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.