473,385 Members | 1,877 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,385 software developers and data experts.

Access db problem from .NET

I have a small application that will copy two tables from one access databas
to another, the tables are present in the destination database and I only
copy the data over. So there is no created on the databases. I do this by
filling a DataSet and then Copy() to another Dataset and Update() the
destination Database's Adapter

Everything works fine except for ONE thing...

One field is of Date/Time type and when I copy ONLY the Date is copied over
the right way and not the time... the time turns into 00:00:00 on all the
records but the Date is correct!

for example
2004-05-24 08:10:03 will turn into -> 2004-05-24 00:00:00

Any idea what this can come of?

Best Regards
/Lars
Nov 20 '05 #1
4 845
Hi Lars,

Not that I know the answer direct however is your copy only a

datatablenew = datatableold.copy

Or do you use another method?

Cor
Nov 20 '05 #2

Yes that's how I copy... but I actually copy on the Dataset level, the
dataset contains both Tables then..

So it'd be:

DatasetNew = DatasetOld.Copy()

/Lars

"Cor Ligthert" <no**********@planet.nl> skrev i meddelandet
news:e4*************@TK2MSFTNGP11.phx.gbl...
Hi Lars,

Not that I know the answer direct however is your copy only a

datatablenew = datatableold.copy

Or do you use another method?

Cor

Nov 20 '05 #3
Hi Lars,

I tested this
\\\
Dim ds As New DataSet
Dim dt As New DataTable
Dim dc As New DataColumn
dc.DataType = GetType(DateAndTime)
dt.Columns.Add(dc)
ds.Tables.Add(dt)
Dim dr As DataRow = dt.NewRow
dr(0) = Now
ds.Tables(0).Rows.Add(dr)
MessageBox.Show(ds.Tables(0).Rows(0)(0).ToString)
Dim dsnew As New DataSet
dsnew = ds.Copy
MessageBox.Show(dsnew.Tables(0).Rows(0)(0).ToStrin g)
///
They both give the same date and time,

What do I not understand?

Cor
Nov 20 '05 #4
Not sure..

In the database though the there are two fileds (of which I am NOT in charge
of designing).

"Date" and "TimeWritten"

Both are of Date/time type but in the "Date" field there's only a datevalue
when createing the record amd in the "TimeWritten" only a Timevalue is
written... I'm thinking maybe this is wrong?

What I mean is that when the record is created the "date" field get this
information "2005-05-24" while the "TimeWritten" only get "08:10:03" ....

I myself think it's unnessessarry to have two fields for this but I can't
really change that and it's a strnge error anyway..

/Lars

"Cor Ligthert" <no**********@planet.nl> skrev i meddelandet
news:ub**************@TK2MSFTNGP12.phx.gbl...
Hi Lars,

I tested this
\\\
Dim ds As New DataSet
Dim dt As New DataTable
Dim dc As New DataColumn
dc.DataType = GetType(DateAndTime)
dt.Columns.Add(dc)
ds.Tables.Add(dt)
Dim dr As DataRow = dt.NewRow
dr(0) = Now
ds.Tables(0).Rows.Add(dr)
MessageBox.Show(ds.Tables(0).Rows(0)(0).ToString)
Dim dsnew As New DataSet
dsnew = ds.Copy
MessageBox.Show(dsnew.Tables(0).Rows(0)(0).ToStrin g)
///
They both give the same date and time,

What do I not understand?

Cor

Nov 20 '05 #5

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

Similar topics

63
by: Jerome | last post by:
Hi, I'm a bit confused ... when would I rather write an database application using MS Access and Visual Basic and when (and why) would I rather write it using Visual Studio .Net? Is it as easy...
14
by: Sean C. | last post by:
Helpful folks, Most of my previous experience with DB2 was on s390 mainframe systems and the optimizer on this platform always seemed very predictable and consistent. Since moving to a WinNT/UDB...
49
by: Yannick Turgeon | last post by:
Hello, We are in the process of examining our current main application. We have to do some major changes and, in the process, are questionning/validating the use of MS Access as front-end. The...
8
by: Mike MacSween | last post by:
tblCourses one to many to tblEvents. A course may have an intro workshop (a type of event), a mid course workshop, a final exam. Or any combination. Or something different in the future. At...
35
by: deko | last post by:
Do I get more scalability if I split my database? The way I calculate things now, I'll be lucky to get 100,000 records in my Access 2003 mdb. Here some math: Max mdb/mde size = 2000 x 1024 =...
22
by: Deano | last post by:
Hi, I have a finished Microsoft Access app that we are distributing using an Access runtime. This works fine (mostly) but I'm sold on the advantages of dot.NET and upgrading to vb.NET seems...
52
by: Neil | last post by:
We are running an Access 2000 MDB with a SQL 7 back end. Our network guy is upgrading to Windows Server 2003 and wants to upgrade Office and SQL Server at the same time. We're moving to SQL Server...
15
by: Cheryl Langdon | last post by:
Hello everyone, This is my first attempt at getting help in this manner. Please forgive me if this is an inappropriate request. I suddenly find myself in urgent need of instruction on how to...
17
by: Mell via AccessMonster.com | last post by:
Is there a way to find out where an application was created from? i.e. - work or home i.e. - if application sits on a (work) server/network, the IT people know the application is sitting...
37
by: jasmith | last post by:
How will Access fair in a year? Two years? .... The new version of Access seems to service non programmers as a wizard interface to quickly create databases via a fancy wizard. Furthermore, why...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.