I have a dataview, and I am trying to "clone" its structure only in part, by creating a new table via code. I cut out most of the columns, so this is easier to read. My question is - Why does this always seem to add things a a string?
Later in my code, I try to sort based on "View_Order ", but it acts like a string. The values sort as 1,2,20,21,22,3, 4, NOT 1,2,3,4,20,21,2 2 like it should.
Using Cint() while moving the values from table to table didn't work for me... and the boolean becomes text as well. Is the problem in this code, or would it be elsewhere? -
Private Function ConvertTable(ByVal ds As DataSet, ByVal TableName As String, Byval WHEREexpression As String, Byval SORTexpression As String) As DataTable
-
'For Schedule Tasks, convert all "dates+times" to "dates only" as strings
-
-
Dim dv As DataView = GetViewTable(ds.Tables(TableName), WHEREexppression, SORTexpression)
-
Dim dt As New DataTable
-
-
dt.Columns.Add(New DataColumn("Task", GetType(String)))
-
dt.Columns.Add(New DataColumn("View_Order", System.Type.GetType("System.Int64")))
-
dt.Columns.Add(New DataColumn("Completed", GetType(Boolean)))
-
-
For i = 0 To dv.Table.Rows.Count - 1
-
dt.Rows.Add()
-
-
dt.Rows(i).Item("Task") = dv.Table.Rows(i).Item("Task").ToString
-
-
dt.Rows(i).Item("View_Order") = CInt(dv.Table.Rows(i).Item("View_Order").ToString)
-
Try
-
dt.Rows(i).Item("Completed") = dv.Table.Rows(i).Item("Completed")
-
Catch ex As Exception
-
End Try
-
Next i
-
-
Return dt
-
End Function
-
1 24468
Nevermind... I found the solution. The problem was that eveything had already been converted to strings before I ran the function.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Igor Shevchenko |
last post by:
Hi,
Are there any plans on adding CLUSTER-related information to "\d tablename" ?
--
Best regards,
Igor Shevchenko
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend
|
by: Supra |
last post by:
value of type "Integer" cannot be convert to system.color
Public Sub APIHighlight2(ByVal BgColour As Integer, ByVal FgColour As
Integer)
SelectionHighlightBackColour(BgColour)
Dim rtb As New RichTextBox
rtb.ForeColor = FgColour ===> error occured in fgcolour
End Sub
regards,
|
by: Supra |
last post by:
value of type "Integer" cannot be convert to system.color.
in procedure events:
Function doColor(ByVal rtb As RichTextBox, ByVal a As String)
Dim bColor, fColor, fgcolor, bgcolor As Integer
..
..
..
fColor=Colour(fgcolor) ===> error occured in fgcolour
..
..
|
by: **Developer** |
last post by:
Notice below I sometimes used the "A" version. I found by cut-and-try that
only the "A" version would work correctly. Anyone have a suggestion of why
the "W" version would not work correctly?
One reason is that the ByRef or ByVal does not show by InteliSence so the
"p" would help there.
------
Secondly, I'd like to be consistent with the parameter names. I'd like to
|
by: Ron L |
last post by:
I have a data table that lists a series of items in my database. In my user
form, I want the user to be able to filter by a number of criteria (e.g.
location, contract, date modified, etc). Other than modified date, all my
filters are selected via combo boxes. I would like to have the combo boxes
update so that if there are no items available in the currently filtered
list for a given selection, that selection will not appear in the...
| |
by: Zygo Blaxell |
last post by:
I have a table with a few million rows of temperature data keyed
by timestamp. I want to group these rows by timestamp intervals
(e.g. every 32 seconds), compute aggregate functions on the columns,
and ultimately feed the result into a graph-drawing web thingy.
I'm trying a few different ways to get what seems to be the same data,
and seeing some odd behavior from the query planner.
The table looks like this:
|
by: Prabu Subroto |
last post by:
Dear my friends...
I am using postgres 7.4 and SuSE 9.1.
I want to use auto_increment as on MySQL. I look up
the documentation on www.postgres.com and I found
"serial" .
But I don't know how to create auto_increment.
here is my try:
|
by: Ying Lu |
last post by:
Hi,
I have a question about alter a column's type in a postgreSQL table.
For example, I have 10, 000 records in a table name "test", I'd like to
change column "machineID" type from integer to varchar. I am looking for
something like:
alter table test alter column machineID ... ... varchar
|
by: coaxfiber |
last post by:
why is it that when i used the value with zero,comparing two integers,it seems that i got the wrong ouput?
Please consider the ff:
#!/bin/ksh
echo "63918000009" > k
cat k
read x < k
(( aj=63918000009 ))
if
|
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...
|
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,...
| |
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...
|
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,...
|
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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
| |