Click here to Skip to main content
15,891,529 members
Home / Discussions / C#
   

C#

 
Questioncatch an object returned by java webservice in c# application. Pin
prasadbuddhika6-May-09 17:39
prasadbuddhika6-May-09 17:39 
AnswerRe: catch an object returned by java webservice in c# application. Pin
Spunky Coder6-May-09 20:00
Spunky Coder6-May-09 20:00 
QuestionBackup Program Pin
nsimbu6-May-09 14:08
nsimbu6-May-09 14:08 
QuestionListView Pin
al3xutzu006-May-09 12:26
al3xutzu006-May-09 12:26 
AnswerRe: ListView Pin
Henry Minute6-May-09 13:37
Henry Minute6-May-09 13:37 
AnswerRe: ListView Pin
Roberto Ho6-May-09 13:50
Roberto Ho6-May-09 13:50 
AnswerRe: ListView Pin
nsimbu6-May-09 13:51
nsimbu6-May-09 13:51 
QuestionConvert .Net datatype to Mysql datatype Pin
student19886-May-09 12:14
student19886-May-09 12:14 
Hi people,

I have the a form in my application where the user can enter a data and time and then save it to a Mysql database. but I get a FormatExeption saying "Input string was not in a correct format" How can I convert from .net datatime datatype to Mysql database type ?

Heres my method for inserting a row that contains a datetime datatype
private void shiftInsertNewRow()
{
conn = new MySqlConnection
("datasource=localhost;username=admin;password=student;database=hospital");
conn.Open();


MySqlCommand command = new MySqlCommand
("insert into shifts(ShiftID, Starttime, Endtime, WardID, NurseID) select ?ShiftID, ?Starttime, ?Endtime, ?WardID, ?NurseID", conn);

command.Parameters.Add(new MySqlParameter("?ShiftID", MySqlDbType.Int32));
command.Parameters.Add(new MySqlParameter("?Starttime", MySqlDbType.Datetime));
command.Parameters.Add(new MySqlParameter("?Endtime", MySqlDbType.Datetime));
command.Parameters.Add(new MySqlParameter("?WardID", MySqlDbType.Int32));
command.Parameters.Add(new MySqlParameter("?NurseID", MySqlDbType.Int32));


command.Parameters[0].Value = shiftidTextBox.Text;
command.Parameters[1].Value = startTimeTextBox.Text;
command.Parameters[2].Value = endTimTextBox.Text;
command.Parameters[3].Value = wardShiftidTextBox.Text;
command.Parameters[4].Value = wardNameTextBox.Text;

command.ExecuteNonQuery();

conn.Close();
}

any help would be greatly appreciated Smile | :)
AnswerRe: Convert .Net datatype to Mysql datatype Pin
Colin Angus Mackay6-May-09 12:21
Colin Angus Mackay6-May-09 12:21 
GeneralRe: Convert .Net datatype to Mysql datatype Pin
student19886-May-09 12:37
student19886-May-09 12:37 
GeneralRe: Convert .Net datatype to Mysql datatype Pin
Colin Angus Mackay6-May-09 12:47
Colin Angus Mackay6-May-09 12:47 
GeneralRe: Convert .Net datatype to Mysql datatype Pin
student19886-May-09 13:01
student19886-May-09 13:01 
GeneralRe: Convert .Net datatype to Mysql datatype Pin
Luc Pattyn6-May-09 13:09
sitebuilderLuc Pattyn6-May-09 13:09 
GeneralRe: Convert .Net datatype to Mysql datatype Pin
student19886-May-09 13:26
student19886-May-09 13:26 
GeneralRe: Convert .Net datatype to Mysql datatype Pin
Luc Pattyn6-May-09 13:58
sitebuilderLuc Pattyn6-May-09 13:58 
QuestionGateway port forwarding Pin
evangile6-May-09 11:47
evangile6-May-09 11:47 
AnswerRe: Gateway port forwarding Pin
harold aptroot6-May-09 11:59
harold aptroot6-May-09 11:59 
GeneralRe: Gateway port forwarding Pin
evangile6-May-09 12:05
evangile6-May-09 12:05 
QuestionRe: Gateway port forwarding Pin
harold aptroot6-May-09 12:10
harold aptroot6-May-09 12:10 
AnswerRe: Gateway port forwarding Pin
evangile6-May-09 12:17
evangile6-May-09 12:17 
GeneralRe: Gateway port forwarding Pin
harold aptroot6-May-09 22:08
harold aptroot6-May-09 22:08 
GeneralRe: Gateway port forwarding Pin
evangile6-May-09 23:05
evangile6-May-09 23:05 
GeneralRe: Gateway port forwarding Pin
harold aptroot6-May-09 23:36
harold aptroot6-May-09 23:36 
QuestionFind out if a class is initialized with reflection. Pin
belzer6-May-09 11:26
belzer6-May-09 11:26 
QuestionProcess.Kill() problem Pin
Mel Feik6-May-09 10:42
Mel Feik6-May-09 10:42 

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.