473,779 Members | 2,038 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Populating date into SQL

Hi

Having trouble filling a datetime filed in SQL table with a value from an
array.

The original source is a comma-delimited text file where the date and time
values are in two columns. I require to combine the two colums into one
datetime field in the SQL table

Here is what I am doing

FileOpen(1, my_file_to_vali date, OpenMode.Binary )

MyArray = New String(My_Recor dCount - 1, 38) {}
For row = 0 To My_RecordCount - 1
myrecord = LineInput(1)
Dim x = Split(myrecord, ",")
Dim MyItemDate as Date

MyItemDate = New Date(Microsoft. VisualBasic.Lef t(x(3), 4), _
Microsoft.Visua lBasic.Mid(x(3) , 5, 2), _
Microsoft.Visua lBasic.Right(x( 3), 2), _
Microsoft.Visua lBasic.Left(x(2 ), 2), _
Microsoft.Visua lBasic.Mid(x(2) , 3, 2), _
Microsoft.Visua lBasic.Mid(x(2) , 5, 2))
MyArray_Array(r ow, 2) = CallDate

The above opens the text file and populates the array

....and when that is completed the following is supposed to take the date
value from array and insert it into the SQL table .... BUT ..... I receive
errors at the "myCommand.Exec uteNonQuery()" line indiacting that the value
cannot be accepted because it is not the right format and cannot be converted.
For i = 0 To UBound(MyArray)

myConnection = New SqlConnection _
("Data
Source=.\SQLEXP RESS;AttachDbFi lename=|DataDir ectory|" _
+ "\Beta_MyInfo.m df;Integrated Security=True;U ser
Instance=True")
myConnection.Op en()
insertCMD = "Insert into MyLog (Date) values ('" &
MyArray(i, 2) & "');"
myCommand = New SqlCommand(inse rtCMD, myConnection)
myCommand.Execu teNonQuery()
myConnection.Cl ose()

Next

Any ideas where I might be going wrong

Thanks

Michael Bond

Aug 14 '06 #1
5 1571
MyArray appears to be just strings, perhaps MyArray(x,2) is not a valid
date?

You can test that the field is properly populated.

myConnection = New Data.SqlClient. SqlConnection _
("Data Source=.\SQLEXP RESS;AttachDbFi lename=|DataDir ectory|" _
+ "\Beta_MyInfo.m df;Integrated Security=True;U ser
Instance=True")

Dim trans As SqlClient.SqlTr ansaction 'Transaction object
Dim myCommand As SqlClient.SqlCo mmand '
Dim insertCMD As String 'SQL String,
' consider using paramaters as they
are more
' porable over versions of RDBMS
Dim iRet As Integer 'Test that every insert inserted
one record
Dim AllClear As Boolean 'Tests for completeness

'Set flag
AllClear = True

'Open connection
myConnection.Op en()

'Create a transaction
trans = myConnection.Be ginTransaction

'Loop over fields to be inserted
For i As Integer = 0 To UBound(MyArray)

Try

'Test our fields
Debug.Assert(Is Date(MyArray(i, 2)) = True, "Invalid value
specified"))
Trace.WriteLine If(IsDate(MyArr ay(i, 2)) = True, "Invalid value
specified"))

'Populate sql
insertCMD = String.Format(" Insert into MyLog (Date) values
('{0}');", MyArray(i, 2))

'Initialize our command object
myCommand = New SqlClient.SqlCo mmand(insertCMD , myConnection, trans)

'Execute our SQL
iRet = myCommand.Execu teNonQuery()

myCommand.Dispo se()

'Test results
Debug.Assert(iR et = 1, String.Format(" Expected one record to be
inserted, instead {0} were inserted.", iRet))
Trace.WriteLine If(iRet = 1, String.Format(" Expected one record to be
inserted, instead {0} were inserted.", iRet))

Catch ex As SqlClient.SqlEx ception

AllClear = False

'Clean up
myCommand.Dispo se()

Dim cmd As SqlClient.SqlCo mmand

cmd = New SqlClient.SqlCo mmand()
cmd.Connection = myConnection : cmd.Transaction = trans :
cmd.Transaction .Rollback()
cmd.Dispose()

Exit For
Catch ex As Exception
'Something more bad happened here.
AllClear = False
End Try

Next

If AllClear Then

Dim cmd As SqlClient.SqlCo mmand

cmd = New SqlClient.SqlCo mmand()
cmd.Connection = myConnection : cmd.Transaction = trans :
cmd.Transaction .Commit()
cmd.Dispose()

End If

myConnection.Cl ose()
myConnection.Di spose()

"mabond" <ma****@discuss ions.microsoft. comwrote in message
news:3A******** *************** ***********@mic rosoft.com...
Hi

Having trouble filling a datetime filed in SQL table with a value from an
array.

The original source is a comma-delimited text file where the date and time
values are in two columns. I require to combine the two colums into one
datetime field in the SQL table

Here is what I am doing

FileOpen(1, my_file_to_vali date, OpenMode.Binary )

MyArray = New String(My_Recor dCount - 1, 38) {}
For row = 0 To My_RecordCount - 1
myrecord = LineInput(1)
Dim x = Split(myrecord, ",")
Dim MyItemDate as Date

MyItemDate = New Date(Microsoft. VisualBasic.Lef t(x(3), 4),
_
Microsoft.Visua lBasic.Mid(x(3) , 5, 2), _
Microsoft.Visua lBasic.Right(x( 3), 2), _
Microsoft.Visua lBasic.Left(x(2 ), 2), _
Microsoft.Visua lBasic.Mid(x(2) , 3, 2), _
Microsoft.Visua lBasic.Mid(x(2) , 5, 2))
MyArray_Array(r ow, 2) = CallDate

The above opens the text file and populates the array

...and when that is completed the following is supposed to take the date
value from array and insert it into the SQL table .... BUT ..... I receive
errors at the "myCommand.Exec uteNonQuery()" line indiacting that the value
cannot be accepted because it is not the right format and cannot be
converted.
For i = 0 To UBound(MyArray)

myConnection = New SqlConnection _
("Data
Source=.\SQLEXP RESS;AttachDbFi lename=|DataDir ectory|" _
+ "\Beta_MyInfo.m df;Integrated Security=True;U ser
Instance=True")
myConnection.Op en()
insertCMD = "Insert into MyLog (Date) values ('" &
MyArray(i, 2) & "');"
myCommand = New SqlCommand(inse rtCMD, myConnection)
myCommand.Execu teNonQuery()
myConnection.Cl ose()

Next

Any ideas where I might be going wrong

Thanks

Michael Bond

Aug 14 '06 #2
erm ..... not sure how that helps. I already know the field is not being
populated because I get an error

The content of MyArray(i,2) (i being 0 for the first record) reads exactly
as follows:

"13/08/2006 00:00:15" ..... so my question is how do I get my code to write
that in such a way as it will be recognised as a valid datetime for a
datetime field in SQL

To ensure I have a date value I have tried the following

dim mydate as date
mydate = myarray(i,2)

This gives an exact value to the variable which reads

"#8/13/2006 00:00:15 AM#"

But I can't find the correct syntax to put that variable into my insert
command
insertCMD = "Insert into CallLog (Date) values calldate;"
insertCMD = "Insert into CallLog (Date) values (calldate);"
insertCMD = "Insert into CallLog (Date) values ("calldate") ;"
do not work

Michael
"AMDRIT" wrote:
MyArray appears to be just strings, perhaps MyArray(x,2) is not a valid
date?

You can test that the field is properly populated.

myConnection = New Data.SqlClient. SqlConnection _
("Data Source=.\SQLEXP RESS;AttachDbFi lename=|DataDir ectory|" _
+ "\Beta_MyInfo.m df;Integrated Security=True;U ser
Instance=True")

Dim trans As SqlClient.SqlTr ansaction 'Transaction object
Dim myCommand As SqlClient.SqlCo mmand '
Dim insertCMD As String 'SQL String,
' consider using paramaters as they
are more
' porable over versions of RDBMS
Dim iRet As Integer 'Test that every insert inserted
one record
Dim AllClear As Boolean 'Tests for completeness

'Set flag
AllClear = True

'Open connection
myConnection.Op en()

'Create a transaction
trans = myConnection.Be ginTransaction

'Loop over fields to be inserted
For i As Integer = 0 To UBound(MyArray)

Try

'Test our fields
Debug.Assert(Is Date(MyArray(i, 2)) = True, "Invalid value
specified"))
Trace.WriteLine If(IsDate(MyArr ay(i, 2)) = True, "Invalid value
specified"))

'Populate sql
insertCMD = String.Format(" Insert into MyLog (Date) values
('{0}');", MyArray(i, 2))

'Initialize our command object
myCommand = New SqlClient.SqlCo mmand(insertCMD , myConnection, trans)

'Execute our SQL
iRet = myCommand.Execu teNonQuery()

myCommand.Dispo se()

'Test results
Debug.Assert(iR et = 1, String.Format(" Expected one record to be
inserted, instead {0} were inserted.", iRet))
Trace.WriteLine If(iRet = 1, String.Format(" Expected one record to be
inserted, instead {0} were inserted.", iRet))

Catch ex As SqlClient.SqlEx ception

AllClear = False

'Clean up
myCommand.Dispo se()

Dim cmd As SqlClient.SqlCo mmand

cmd = New SqlClient.SqlCo mmand()
cmd.Connection = myConnection : cmd.Transaction = trans :
cmd.Transaction .Rollback()
cmd.Dispose()

Exit For
Catch ex As Exception
'Something more bad happened here.
AllClear = False
End Try

Next

If AllClear Then

Dim cmd As SqlClient.SqlCo mmand

cmd = New SqlClient.SqlCo mmand()
cmd.Connection = myConnection : cmd.Transaction = trans :
cmd.Transaction .Commit()
cmd.Dispose()

End If

myConnection.Cl ose()
myConnection.Di spose()

"mabond" <ma****@discuss ions.microsoft. comwrote in message
news:3A******** *************** ***********@mic rosoft.com...
Hi

Having trouble filling a datetime filed in SQL table with a value from an
array.

The original source is a comma-delimited text file where the date and time
values are in two columns. I require to combine the two colums into one
datetime field in the SQL table

Here is what I am doing

FileOpen(1, my_file_to_vali date, OpenMode.Binary )

MyArray = New String(My_Recor dCount - 1, 38) {}
For row = 0 To My_RecordCount - 1
myrecord = LineInput(1)
Dim x = Split(myrecord, ",")
Dim MyItemDate as Date

MyItemDate = New Date(Microsoft. VisualBasic.Lef t(x(3), 4),
_
Microsoft.Visua lBasic.Mid(x(3) , 5, 2), _
Microsoft.Visua lBasic.Right(x( 3), 2), _
Microsoft.Visua lBasic.Left(x(2 ), 2), _
Microsoft.Visua lBasic.Mid(x(2) , 3, 2), _
Microsoft.Visua lBasic.Mid(x(2) , 5, 2))
MyArray_Array(r ow, 2) = CallDate

The above opens the text file and populates the array

...and when that is completed the following is supposed to take the date
value from array and insert it into the SQL table .... BUT ..... I receive
errors at the "myCommand.Exec uteNonQuery()" line indiacting that the value
cannot be accepted because it is not the right format and cannot be
converted.
For i = 0 To UBound(MyArray)

myConnection = New SqlConnection _
("Data
Source=.\SQLEXP RESS;AttachDbFi lename=|DataDir ectory|" _
+ "\Beta_MyInfo.m df;Integrated Security=True;U ser
Instance=True")
myConnection.Op en()
insertCMD = "Insert into MyLog (Date) values ('" &
MyArray(i, 2) & "');"
myCommand = New SqlCommand(inse rtCMD, myConnection)
myCommand.Execu teNonQuery()
myConnection.Cl ose()

Next

Any ideas where I might be going wrong

Thanks

Michael Bond


Aug 14 '06 #3
SQL doesn't understand #date#, it does understand 'date'. Perhaps that is
all there is to it.


"mabond" <ma****@discuss ions.microsoft. comwrote in message
news:F3******** *************** ***********@mic rosoft.com...
erm ..... not sure how that helps. I already know the field is not being
populated because I get an error

The content of MyArray(i,2) (i being 0 for the first record) reads exactly
as follows:

"13/08/2006 00:00:15" ..... so my question is how do I get my code to
write
that in such a way as it will be recognised as a valid datetime for a
datetime field in SQL

To ensure I have a date value I have tried the following

dim mydate as date
mydate = myarray(i,2)

This gives an exact value to the variable which reads

"#8/13/2006 00:00:15 AM#"

But I can't find the correct syntax to put that variable into my insert
command
insertCMD = "Insert into CallLog (Date) values calldate;"
insertCMD = "Insert into CallLog (Date) values (calldate);"
insertCMD = "Insert into CallLog (Date) values ("calldate") ;"
do not work

Michael
"AMDRIT" wrote:
>MyArray appears to be just strings, perhaps MyArray(x,2) is not a valid
date?

You can test that the field is properly populated.

myConnection = New Data.SqlClient. SqlConnection _
("Data Source=.\SQLEXP RESS;AttachDbFi lename=|DataDir ectory|"
_
+ "\Beta_MyInfo.m df;Integrated Security=True;U ser
Instance=True" )

Dim trans As SqlClient.SqlTr ansaction 'Transaction object
Dim myCommand As SqlClient.SqlCo mmand '
Dim insertCMD As String 'SQL String,
' consider using paramaters as
they
are more
' porable over versions of RDBMS
Dim iRet As Integer 'Test that every insert
inserted
one record
Dim AllClear As Boolean 'Tests for completeness

'Set flag
AllClear = True

'Open connection
myConnection.Op en()

'Create a transaction
trans = myConnection.Be ginTransaction

'Loop over fields to be inserted
For i As Integer = 0 To UBound(MyArray)

Try

'Test our fields
Debug.Assert(Is Date(MyArray(i, 2)) = True, "Invalid value
specified"))
Trace.WriteLine If(IsDate(MyArr ay(i, 2)) = True, "Invalid value
specified"))

'Populate sql
insertCMD = String.Format(" Insert into MyLog (Date) values
('{0}');", MyArray(i, 2))

'Initialize our command object
myCommand = New SqlClient.SqlCo mmand(insertCMD , myConnection,
trans)

'Execute our SQL
iRet = myCommand.Execu teNonQuery()

myCommand.Dispo se()

'Test results
Debug.Assert(iR et = 1, String.Format(" Expected one record to be
inserted, instead {0} were inserted.", iRet))
Trace.WriteLine If(iRet = 1, String.Format(" Expected one record to
be
inserted, instead {0} were inserted.", iRet))

Catch ex As SqlClient.SqlEx ception

AllClear = False

'Clean up
myCommand.Dispo se()

Dim cmd As SqlClient.SqlCo mmand

cmd = New SqlClient.SqlCo mmand()
cmd.Connection = myConnection : cmd.Transaction = trans :
cmd.Transactio n.Rollback()
cmd.Dispose()

Exit For
Catch ex As Exception
'Something more bad happened here.
AllClear = False
End Try

Next

If AllClear Then

Dim cmd As SqlClient.SqlCo mmand

cmd = New SqlClient.SqlCo mmand()
cmd.Connection = myConnection : cmd.Transaction = trans :
cmd.Transactio n.Commit()
cmd.Dispose()

End If

myConnection.Cl ose()
myConnection.Di spose()

"mabond" <ma****@discuss ions.microsoft. comwrote in message
news:3A******* *************** ************@mi crosoft.com...
Hi

Having trouble filling a datetime filed in SQL table with a value from
an
array.

The original source is a comma-delimited text file where the date and
time
values are in two columns. I require to combine the two colums into one
datetime field in the SQL table

Here is what I am doing

FileOpen(1, my_file_to_vali date, OpenMode.Binary )

MyArray = New String(My_Recor dCount - 1, 38) {}
For row = 0 To My_RecordCount - 1
myrecord = LineInput(1)
Dim x = Split(myrecord, ",")
Dim MyItemDate as Date

MyItemDate = New Date(Microsoft. VisualBasic.Lef t(x(3),
4),
_
Microsoft.Visua lBasic.Mid(x(3) , 5, 2), _
Microsoft.Visua lBasic.Right(x( 3), 2), _
Microsoft.Visua lBasic.Left(x(2 ), 2), _
Microsoft.Visua lBasic.Mid(x(2) , 3, 2), _
Microsoft.Visua lBasic.Mid(x(2) , 5, 2))
MyArray_Array(r ow, 2) = CallDate

The above opens the text file and populates the array

...and when that is completed the following is supposed to take the
date
value from array and insert it into the SQL table .... BUT ..... I
receive
errors at the "myCommand.Exec uteNonQuery()" line indiacting that the
value
cannot be accepted because it is not the right format and cannot be
converted.
For i = 0 To UBound(MyArray)

myConnection = New SqlConnection _
("Data
Source=.\SQLEXP RESS;AttachDbFi lename=|DataDir ectory|" _
+ "\Beta_MyInfo.m df;Integrated Security=True;U ser
Instance=True")
myConnection.Op en()
insertCMD = "Insert into MyLog (Date) values ('" &
MyArray(i, 2) & "');"
myCommand = New SqlCommand(inse rtCMD, myConnection)
myCommand.Execu teNonQuery()
myConnection.Cl ose()

Next

Any ideas where I might be going wrong

Thanks

Michael Bond



Aug 14 '06 #4
Hi

I've resolved the problem by the use of parameters

the following meets my needs

insertCMD = "Insert into MyLog (Date) values (@MYDATE);"
myCommand = New SqlCommand(inse rtCMD, myConnection)
mycommand.param eters.add(new sqlparamter("@m ydate",sqldbtyp e.datetime))
mycommand.param eters(0).value = cdate(myarray(i ,0))
myCommand.Execu teNonQuery()

Thanks for the pointers

Michael Bond
"AMDRIT" wrote:
SQL doesn't understand #date#, it does understand 'date'. Perhaps that is
all there is to it.


"mabond" <ma****@discuss ions.microsoft. comwrote in message
news:F3******** *************** ***********@mic rosoft.com...
erm ..... not sure how that helps. I already know the field is not being
populated because I get an error

The content of MyArray(i,2) (i being 0 for the first record) reads exactly
as follows:

"13/08/2006 00:00:15" ..... so my question is how do I get my code to
write
that in such a way as it will be recognised as a valid datetime for a
datetime field in SQL

To ensure I have a date value I have tried the following

dim mydate as date
mydate = myarray(i,2)

This gives an exact value to the variable which reads

"#8/13/2006 00:00:15 AM#"

But I can't find the correct syntax to put that variable into my insert
command
insertCMD = "Insert into CallLog (Date) values calldate;"
insertCMD = "Insert into CallLog (Date) values (calldate);"
insertCMD = "Insert into CallLog (Date) values ("calldate") ;"
do not work

Michael
"AMDRIT" wrote:
MyArray appears to be just strings, perhaps MyArray(x,2) is not a valid
date?

You can test that the field is properly populated.

myConnection = New Data.SqlClient. SqlConnection _
("Data Source=.\SQLEXP RESS;AttachDbFi lename=|DataDir ectory|"
_
+ "\Beta_MyInfo.m df;Integrated Security=True;U ser
Instance=True")

Dim trans As SqlClient.SqlTr ansaction 'Transaction object
Dim myCommand As SqlClient.SqlCo mmand '
Dim insertCMD As String 'SQL String,
' consider using paramaters as
they
are more
' porable over versions of RDBMS
Dim iRet As Integer 'Test that every insert
inserted
one record
Dim AllClear As Boolean 'Tests for completeness

'Set flag
AllClear = True

'Open connection
myConnection.Op en()

'Create a transaction
trans = myConnection.Be ginTransaction

'Loop over fields to be inserted
For i As Integer = 0 To UBound(MyArray)

Try

'Test our fields
Debug.Assert(Is Date(MyArray(i, 2)) = True, "Invalid value
specified"))
Trace.WriteLine If(IsDate(MyArr ay(i, 2)) = True, "Invalid value
specified"))

'Populate sql
insertCMD = String.Format(" Insert into MyLog (Date) values
('{0}');", MyArray(i, 2))

'Initialize our command object
myCommand = New SqlClient.SqlCo mmand(insertCMD , myConnection,
trans)

'Execute our SQL
iRet = myCommand.Execu teNonQuery()

myCommand.Dispo se()

'Test results
Debug.Assert(iR et = 1, String.Format(" Expected one record to be
inserted, instead {0} were inserted.", iRet))
Trace.WriteLine If(iRet = 1, String.Format(" Expected one record to
be
inserted, instead {0} were inserted.", iRet))

Catch ex As SqlClient.SqlEx ception

AllClear = False

'Clean up
myCommand.Dispo se()

Dim cmd As SqlClient.SqlCo mmand

cmd = New SqlClient.SqlCo mmand()
cmd.Connection = myConnection : cmd.Transaction = trans :
cmd.Transaction .Rollback()
cmd.Dispose()

Exit For
Catch ex As Exception
'Something more bad happened here.
AllClear = False
End Try

Next

If AllClear Then

Dim cmd As SqlClient.SqlCo mmand

cmd = New SqlClient.SqlCo mmand()
cmd.Connection = myConnection : cmd.Transaction = trans :
cmd.Transaction .Commit()
cmd.Dispose()

End If

myConnection.Cl ose()
myConnection.Di spose()

"mabond" <ma****@discuss ions.microsoft. comwrote in message
news:3A******** *************** ***********@mic rosoft.com...
Hi

Having trouble filling a datetime filed in SQL table with a value from
an
array.

The original source is a comma-delimited text file where the date and
time
values are in two columns. I require to combine the two colums into one
datetime field in the SQL table

Here is what I am doing

FileOpen(1, my_file_to_vali date, OpenMode.Binary )

MyArray = New String(My_Recor dCount - 1, 38) {}
For row = 0 To My_RecordCount - 1
myrecord = LineInput(1)
Dim x = Split(myrecord, ",")
Dim MyItemDate as Date

MyItemDate = New Date(Microsoft. VisualBasic.Lef t(x(3),
4),
_
Microsoft.Visua lBasic.Mid(x(3) , 5, 2), _
Microsoft.Visua lBasic.Right(x( 3), 2), _
Microsoft.Visua lBasic.Left(x(2 ), 2), _
Microsoft.Visua lBasic.Mid(x(2) , 3, 2), _
Microsoft.Visua lBasic.Mid(x(2) , 5, 2))
MyArray_Array(r ow, 2) = CallDate

The above opens the text file and populates the array

...and when that is completed the following is supposed to take the
date
value from array and insert it into the SQL table .... BUT ..... I
receive
errors at the "myCommand.Exec uteNonQuery()" line indiacting that the
value
cannot be accepted because it is not the right format and cannot be
converted.
For i = 0 To UBound(MyArray)

myConnection = New SqlConnection _
("Data
Source=.\SQLEXP RESS;AttachDbFi lename=|DataDir ectory|" _
+ "\Beta_MyInfo.m df;Integrated Security=True;U ser
Instance=True")
myConnection.Op en()
insertCMD = "Insert into MyLog (Date) values ('" &
MyArray(i, 2) & "');"
myCommand = New SqlCommand(inse rtCMD, myConnection)
myCommand.Execu teNonQuery()
myConnection.Cl ose()

Next

Any ideas where I might be going wrong

Thanks

Michael Bond



Aug 15 '06 #5
Using a parameter was the right way of fixing it. You should never
send a SQL string directly. You should create a stored procedure and
pass in the values to the UPDATE and let the server handle it. Or, in
your case, the INSERT.

mabond wrote:
Hi

I've resolved the problem by the use of parameters

the following meets my needs

insertCMD = "Insert into MyLog (Date) values (@MYDATE);"
myCommand = New SqlCommand(inse rtCMD, myConnection)
mycommand.param eters.add(new sqlparamter("@m ydate",sqldbtyp e.datetime))
mycommand.param eters(0).value = cdate(myarray(i ,0))
myCommand.Execu teNonQuery()

Thanks for the pointers

Michael Bond
"AMDRIT" wrote:
Aug 15 '06 #6

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

Similar topics

4
2643
by: Mike Wilcox | last post by:
I use the following code snippet to build a drop down menu with the results of a query. How can I set the initial value of this input based on the result of another query? What I am trying to do is update records in the data base. The field WkEndDate is pulled along with the rest of the record and the drop down menu is built from a table of valid WkEndDate values. echo ("Weekend Date: <select name='WkEndDate'/> ");
3
1972
by: Broder | last post by:
Hi there, I am currently running into a somewhat weired problem and hope that this NG is able to help ;-) I have a table in a MSSQL Server in which there is one Column that stores a date. The Format is 04.03.2004 Now I want to populate a Listbox but only with the year from that Column. So if I have lets say 10 entries with *.*.2004 and 5 with *.*.2003 I just want
5
2290
by: | last post by:
Trying to learn about manipulating collections of objects, and populating these objects dynamically from datasources. Could someone post a code sample that shows the following: Instantiating a collection object -- say, a dictionary. Populating that collection object with custom objects, say, Person. What I really want to see is how to populate the properties of those Person objects from a datasource: instantiate one Person, fill...
3
6044
by: sck10 | last post by:
Hello, I am creating a form for users to enter information about a lab and the members of the lab. I have one form (FormView) that they use to enter information about that lab. The keyvalue is "LabLocation_ID". With an existing lab, they then need to add the members for that lab. So, what I am trying to do is the following. With the FormView of the Lab open, the user will click a button to open a FormView (InsertMode) and add a new...
34
7483
by: MLH | last post by:
http://www.opm.gov/Fedhol/ http://www.opm.gov/Fedhol/2008.asp Federal law (5 U.S.C. 6103) establishes the following public holidays for Federal employees. Please note that most Federal employees work on a Monday through Friday schedule. For these employees, when a holiday falls on a nonworkday -- Saturday or Sunday -- the holiday usually is observed on Monday (if the holiday falls on Sunday) or Friday (if the holiday falls on Saturday)....
7
2849
by: dozingquinn | last post by:
Hello, Is there any way to auto populate the user defined date range into a report? I currently have the criteria "Between And " for a date range field. This prompts the user to enter a date range before the report is visible. Is it possible to capture this date range and display it on the report? I am using Access 97 Thanks!
1
1082
by: kimgclark | last post by:
I am trying to get a date that calculate in the control source on a form to update a field in a table. The formula works but does not update the table. This is what I am using: =DateSerial(Year(),Month(),Day()+(\24)) Any ideas?
0
1349
by: Ed Bitzer | last post by:
Appreciate some direction on populating an unbound DataGridView with an one dimensional array of date an appointments (a calendar) read from a coma delimited text file. My original approach was to populate after searching for today's date and then increment a week at a time by repopulating after a PageDown event and changing the start index. No problem with PgUp and PgDn but I find I find myself in the middle of a nightmare controlling...
8
1687
by: dupontk | last post by:
Here it is I have four fields on a form that come from a query. Fields a,b,c,d. a is a text field that looks like a date 1/2/2009, b is a time that looks like 8:00:00 AM and c is a concatanated text field 1/2/2009 8:00:00 AM. Now d is a Date/Time Field formated as General date . I want to set the control property of d to transfer the date which is a text field into the d field so it will be an actual date. So I entered as the control...
0
9474
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
10306
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...
1
10074
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
9930
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
7485
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
6724
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
5503
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4037
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
2
3632
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.