Click here to Skip to main content
16,019,539 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionRe: DatagridviewCheckBoxColumn Pin
vnilo27-Feb-07 2:03
vnilo27-Feb-07 2:03 
AnswerRe: DatagridviewCheckBoxColumn Pin
Dave Kreskowiak27-Feb-07 2:38
mveDave Kreskowiak27-Feb-07 2:38 
GeneralRe: DatagridviewCheckBoxColumn Pin
vnilo27-Feb-07 2:49
vnilo27-Feb-07 2:49 
JokeRe: DatagridviewCheckBoxColumn Pin
Dave Kreskowiak27-Feb-07 14:20
mveDave Kreskowiak27-Feb-07 14:20 
QuestionMy web browser Pin
c3p0b223-Feb-07 11:37
c3p0b223-Feb-07 11:37 
AnswerRe: My web browser Pin
JUNEYT3-Mar-07 4:00
JUNEYT3-Mar-07 4:00 
QuestionReport designer question Pin
dptalt23-Feb-07 9:08
dptalt23-Feb-07 9:08 
Questionformat date Pin
jds120723-Feb-07 8:34
jds120723-Feb-07 8:34 
I am trying to insert some date columns into a MySQL database using vb.net. When trying, I get the error "Incorrect date value: '02/07/2006' for column 'Orderdate' at row 1. MySQL has a date format like YYYY-MM-DD and will not let me insert those dates because of the format. I am inserting text files and the date columns are formatted like MM/DD/YYYY. When I change the data type in the database to varchar, the dates will insert just fine but when I change the data type to date they won't insert in which the date data type is preferred. I have tried so many different things trying to format this including parameterized queries. Any ideas on how to fix this problem?

Here is some code were I tried using the CDate function and got the error "Conversion from string "" to type 'Date' is not valid."

Dim MyCommand As New Odbc.OdbcCommand("INSERT INTO ls_orderitems (OrderDate, OrderCustomer, OrderAcctNum, OrderType, OrderSoNum, OrderItemPartNum, OrderItemPartDesc, OrderItemQty, OrderItemQtyRec, OrderItemQtyDtRec, OrderItemBO, OrderItemBODt,OrderItemCanceled, OrderItemCanceledDt, OrderItemNotes, OrderItemPONum, OrderItemRetailPrice, OrderItemSalePrice, Status, InsertDate) VALUES('" & CDate(OrderDate).ToString("yyyy-MM-dd") & "','" & OrderCustomer & "','" & OrderAcctNum & "','" & OrderType & "','" & OrderSoNum & "','" & OrderItemPartNum & "','" & OrderItemPartDesc & "','" & OrderItemQty & "','" & OrderItemQtyRec & "','" & CDate(OrderItemQtyDtRec).ToString("yyyy-MM-dd") & "','" & OrderItemBO & "','" & CDate(OrderItemBODt).ToString("yyyy-MM-dd") & "','" & OrderItemCanceled & "','" & CDate(OrderItemCanceledDt).ToString("yyyy-MM-dd") & "','" & OrderItemNotes & "','" & OrderItemPONum & "','" & OrderItemRetailPrice & "','" & OrderItemSalePrice & "','" & Status & "','" & InsertDate & "')")


jds1207
AnswerRe: format date Pin
Marcus J. Smith23-Feb-07 8:44
professionalMarcus J. Smith23-Feb-07 8:44 
GeneralRe: format date Pin
jds120723-Feb-07 8:53
jds120723-Feb-07 8:53 
GeneralRe: format date Pin
Marcus J. Smith23-Feb-07 8:57
professionalMarcus J. Smith23-Feb-07 8:57 
AnswerRe: format date Pin
Marcus J. Smith23-Feb-07 9:01
professionalMarcus J. Smith23-Feb-07 9:01 
GeneralRe: format date Pin
jds120723-Feb-07 9:10
jds120723-Feb-07 9:10 
GeneralRe: format date Pin
Marcus J. Smith23-Feb-07 9:16
professionalMarcus J. Smith23-Feb-07 9:16 
GeneralRe: format date Pin
jds120723-Feb-07 9:19
jds120723-Feb-07 9:19 
GeneralRe: format date Pin
Marcus J. Smith23-Feb-07 9:26
professionalMarcus J. Smith23-Feb-07 9:26 
GeneralRe: format date Pin
jds120723-Feb-07 9:53
jds120723-Feb-07 9:53 
GeneralRe: format date Pin
Marcus J. Smith23-Feb-07 10:04
professionalMarcus J. Smith23-Feb-07 10:04 
GeneralRe: format date Pin
Dave Kreskowiak23-Feb-07 10:27
mveDave Kreskowiak23-Feb-07 10:27 
QuestionCaret Size Pin
Anybloodyid23-Feb-07 7:54
Anybloodyid23-Feb-07 7:54 
AnswerRe: Caret Size Pin
Dave Kreskowiak23-Feb-07 10:25
mveDave Kreskowiak23-Feb-07 10:25 
AnswerRe: Caret Size [modified] Pin
TwoFaced23-Feb-07 11:32
TwoFaced23-Feb-07 11:32 
GeneralRe: Caret Size Pin
Dave Kreskowiak23-Feb-07 14:02
mveDave Kreskowiak23-Feb-07 14:02 
GeneralRe: Caret Size Pin
TwoFaced23-Feb-07 14:31
TwoFaced23-Feb-07 14:31 
GeneralRe: Caret Size Pin
Anybloodyid23-Feb-07 22:53
Anybloodyid23-Feb-07 22:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.