So going back to your original problem you should strip off the time before saving the data to the database.
If you have lots of date and time values stored already write a routine that loops through the table rows - loads the dates converts them using the above code and resaves them. I can...
Sorry I wasn't very clear - experiment with the following code and you should see the difference. Note: you should be using the Value of the control not the Text property.
Dim MyDateNoTime, MyDateWithTime As Date
MyDateWithTime = DateTimePicker1.Value
MyDateNoTime =...
Format the date using .ToString("yyyy-MM-dd") when writing the data to the database.
This conforms to ISO 8601 which is the format you should always use when writing dates to a database.
If the database is hosted by an ISP it is very unlikely that the necessary ports are open for you to connect to it. It is intended to be accessed by your web site not remote clients.
Having the ports open is a big security risk for an ISP especially on a server hosting multiple sites. If it...
Yes - to type all this code is a lot of work - I wrote a program to access the database schema and generates all of the classes and strored procedures.
I can guess your next question: Can I have a copy of the source code? - Sorry no, it might still form part of a commercial release however...
The ComboBox1.SelectedItem will not return the ID you were hoping for so I am pretty sure that is the problem.
I never use bound controls so I am not sure how you reference the ID you need but someone will be along soon who can.
It might be ComboBox1.SelectedItem.ValueMember
ooops I just noticed in your profile you are listed as a beginner - you may find the above a bit heavy going - to say the least.
If this is the case and you are still keen to explore this subject I will try and simplify my classes for you. Let me know.
Don't worry about it - the CLR will manage the memory just fine. The memory useage will probably continue to grow until it is needed for something else and at that point the GC/Windows will release it.
ok SQL server version - stored procedures in next post
Imports System.Data.SqlClient
'****************************************************************************
' Code Generated by ViDAL Version 1.0
' for Microsoft.NET 2.0 / SQLServer 2005
' (c)Geraint Williams 2006. All rights reserved...
Well I have looked for that article everywhere but I cannot find it. I guess I have either been misled or I have put 2+2 together and got 5.
I can confirm that the stated function of the NEW keyword is to instanciate the supplied type on the Heap. However (as I know know) if the supplied type...
I am pretty sure anyone who can access a dsn can examine its properties and so defeats your security.
If your data is that sensitive you need to set up a proper security mechanism.
Here is a sample class from the app I wrote to write my table wrappers for me - It uses inline sql and is for MySQL. Let me know if you want to see the SQL Server version with stored procedures.
Imports MySql.Data.MySqlClient...
I was referring to Value / Reference types. I am trying to find my source as we speak - I have looked it up elsewhere though and have been given a different answer. So it is entirely possible I have been mislead. I'll post an answer up soon.
Which is pretty ugly - my way is much neater:
Dim str(6) As String
Dim itm As ListViewItem
Dim transaction As Transaction
For Each transaction In objTransList.Transactions
str(0) = transaction.TransactionDate.ToShortDateString
str(1) = ""
str(2) = transaction.Description.ToString...
You forgot to reinitalise the item object - I have inserted the code below: You need to initalise a new object for every line.
Dim listViewItem As New ListViewItem
listViewItem.SubItems.Add("0")
listViewItem.SubItems.Add("1")
listViewItem.SubItems.Add("2")
listViewItem.SubItems.Add("3")...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.