473,769 Members | 5,518 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to get a datetime for Dataview

ad
I have a DataView, say myDV, it contain a DataTime field, "Birth".
I want to get the Birth Value from the DataView:

DateTiem dBirth= (DateTime)myDV["Birth"];

But the complier throw an error.

How can I get datetime for Dataview?
Nov 17 '05 #1
3 1822
"ad" <ad@wfes.tcc.ed u.tw> wrote in message
news:uQ******** ******@TK2MSFTN GP09.phx.gbl...
I have a DataView, say myDV, it contain a DataTime field, "Birth".
I want to get the Birth Value from the DataView:

DateTiem dBirth= (DateTime)myDV["Birth"];


Try spelling "DateTime" correctly...
Nov 17 '05 #2
In addition to spelling 'DateTime' correctly in the declaration, you didn't
specify which row in the dataview you want. You have to index into it by
row, then by column. Otherwise if you have 10 rows, which 'Birth' value do
you expect to get?

"ad" <ad@wfes.tcc.ed u.tw> wrote in message
news:uQ******** ******@TK2MSFTN GP09.phx.gbl...
I have a DataView, say myDV, it contain a DataTime field, "Birth".
I want to get the Birth Value from the DataView:

DateTiem dBirth= (DateTime)myDV["Birth"];

But the complier throw an error.

How can I get datetime for Dataview?

Nov 17 '05 #3
I wish I were more like Mark and never had a typo!

"Mark Rae" wrote:
"ad" <ad@wfes.tcc.ed u.tw> wrote in message
news:uQ******** ******@TK2MSFTN GP09.phx.gbl...
I have a DataView, say myDV, it contain a DataTime field, "Birth".
I want to get the Birth Value from the DataView:

DateTiem dBirth= (DateTime)myDV["Birth"];


Try spelling "DateTime" correctly...

Nov 17 '05 #4

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

Similar topics

1
11822
by: aaa | last post by:
Hi I am trying to bind Text property of label control to datetime object (attribute from typed dataset). The problem is that I want only to show date part. Currently I use following code: this.dv = new DataView(this.ds.Person); this.labelBirth.DataBindings.Add("Text", this.dv, "BirthdayDate"); When I do this, the text shown is, for example,
0
3512
by: keith | last post by:
In our app, datagrid bound to a dataview that has datetime columns. when sort on the datatime columns (since they are datetime type), date were not sorted property for datetime type. Can you tell how to sore datetime? Thanks
1
3253
by: Jarod | last post by:
Hey I have dtMessages dataTable and there is columnt DateTime, how can I compare dates using DataView ? I need to compare hours more than dates. But the dates are also needed because sometimes 02:00 will be after 23:50 and sometimes before. So I initialize myTime = new DateTime.Now; and I need to compare it with this column, it's initialized in the same way. But it doesn't work for me when I check... : ..rowFilter = "Time <= " + time;...
2
3310
by: Alpha | last post by:
I have a window application. In one of the form, a datagrid has a dataview as its datasource. Initial filtering result would give the datavew 3 items. When I double click on the datagrid to edit the selected lie item at which case I would pop up a separate dialog box to do so, in the debugging code, the dataview.count would return 0. I get a error message because I tried to get values out of a dataview that holds 0 items. Does anyone...
0
1800
by: Harry Haller | last post by:
The context is shown below in the getGames() method. I get errors on these lines: dtGames.Rows = (TimeSpan)dtGames.Rows; dtGames.Rows = (DayOfWeek)dtGames.Rows; because the playDate column is a DateTime. Here is my solution but I don't like it. What else can I do?
5
8834
by: David Wender | last post by:
I want to create a dataview with a sort on multiple columns. However, when I use FindRows, I only want to search some of the columns, not all. Is this possible? I have not been able to make it happen. Dim objKeys(2) as Object objKeys(0) = "CL" objKeys(2) = 4000 Dim posView As DataView = New DataView(posDS.Tables("Positions"), _
0
1870
by: Ripendra007 | last post by:
hi all, i want to filter the date which is in label1.text like dview.RowFilter = "dir_bdate = '"+label1.Text+" '" ; here dir_bdate is my DateTime field of database and label1 contains string in DD/MM/YYYY formate so this is giving me an error like below Error :System.Data.EvaluateException: Cannot perform '=' operation on System.DateTime and System.String. at System.Data.BinaryNode.SetTypeMismatchError(Int32 op, Type left, Type...
11
21920
by: Matt F | last post by:
I'm trying to do something that seems like it should be pretty simple, but haven't found a solution. I am trying to add a datacolumn to a datatable that adds or subtracts a number of days based on another datetime column in the table. See sample below. How do I do this? Any help would be greatly appreciated. Thanks Private Sub CreateDataTable() dt = New DataTable
2
12613
by: Duggi | last post by:
Hi I have a dataview dv, in which one of the column is a date time column. I would like to apply filter on this column. The filter should be some thing like "All the rows that has the date time between DATE1 and DATE2".
0
10211
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10045
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
9994
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
9863
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
7409
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
6673
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
5299
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
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.