473,399 Members | 3,656 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,399 software developers and data experts.

Implicit Conversions in DataRow

I've begun to get exceptions when I try to write a DataRow, "Cannot
implicitly cnvert striung to double..." In the past I didn't have this
problem, but adding code to a solution that worked now throws exceptions:

The string WATERCODE and DBDate SAMPDATE are fine, but the Double STALEN
won't implicitly convert to a string as the value is assigned to the column
in the DataRow. I haven't changed any of the code or types between versions
of the solution, but I have upgraded from Visula Studio 2000 to 2005.

InsertCommand:

this.InsertCommand2.CommandText =
resources.GetString("InsertCommand2.CommandText");
this.InsertCommand2.Connection = this.DC1;
this.InsertCommand2.Parameters.AddRange(new
System.Data.OleDb.OleDbParameter[] {
new System.Data.OleDb.OleDbParameter("WATERCODE",
System.Data.OleDb.OleDbType.VarWChar, 5, "WATERCODE"),
new System.Data.OleDb.OleDbParameter("SAMPDATE",
System.Data.OleDb.OleDbType.DBDate, 0, "SAMPDATE"),
new System.Data.OleDb.OleDbParameter("STA_LEN",
System.Data.OleDb.OleDbType.Double, 0, "STA_LEN"),
....

DataRow:

private void WriteSurveyRecord()
{
try
{
seTable.Clear();
seRow = seTable.NewRow();
seRow[0] = waterCode;
seRow[1] = sampDate;
seRow[2] = stationLength;
....

From the Microsoft training, I was told that the conversions would take
place from the string values stored in the DataRow to the table due to the
generated coding of the InsertCommand and it's mapping. Has this changed
with 2005?

--
Harry E Vermillion
IT2
Division of Wildlife
State of Colorado
Jul 23 '07 #1
0 1172

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

Similar topics

3
by: Reneé | last post by:
I wanted to know the order of implicit conversions and which sort of values allow them. From searching around in books and the archive of this mailing list, it seems to be that only numbers are...
9
by: Simon | last post by:
Hi All, Is it possible to disallow implicit casting for an operand of a function written in C? i.e. void foo(int a) {..} short b; foo(b) // error without explicit cast
15
by: buda | last post by:
Let me see if I got this :) 1. I know the rules for type conversions in arithmetic expressions 2. I know that an implicit type conversion is done at assignment, so float x = 1.23; int t = (int)...
11
by: Steve Gough | last post by:
Could anyone please help me to understand what is happening here? The commented line produces an error, which is what I expected given that there is no conversion defined from type double to type...
9
by: Girish | last post by:
Im trying to understand implicit type conversions from object -> string and vice versa. I have two classes, one Driver and one called StringWrapper. These are just test classes that try and...
11
by: Aaron Queenan | last post by:
Given the classes: class Class { public static implicit operator int(Class c) { return 0; } } class Holder
36
by: Chad Z. Hower aka Kudzu | last post by:
I have an implicit conversion set up in an assembly from a Stream to something else. In C#, it works. In VB it does not. Does VB support implicit conversions? And if so any idea why it would work...
17
by: arindam.mukerjee | last post by:
I was running code like: #include <stdio.h> int main() { printf("%f\n", 9/5); return 0; }
82
by: robert bristow-johnson | last post by:
here is a post i put out (using Google Groups) that got dropped by google: i am using gcc as so: $ gcc -v Using built-in specs. Target: i386-redhat-linux Configured with: ../configure...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
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,...
0
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...
0
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...
0
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...

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.