Click here to Skip to main content
15,884,472 members
Home / Discussions / C#
   

C#

 
QuestionNeed help with updating SQL server express DB from c# Pin
Mark-12345678922-Sep-09 16:15
Mark-12345678922-Sep-09 16:15 
Answerrepost Pin
Luc Pattyn22-Sep-09 16:29
sitebuilderLuc Pattyn22-Sep-09 16:29 
AnswerRe: Need help with updating SQL server express DB from c# Pin
Michael Eber22-Sep-09 18:53
Michael Eber22-Sep-09 18:53 
GeneralRe: Need help with updating SQL server express DB from c# Pin
Mark-12345678923-Sep-09 2:43
Mark-12345678923-Sep-09 2:43 
GeneralRe: Need help with updating SQL server express DB from c# Pin
PIEBALDconsult23-Sep-09 5:12
mvePIEBALDconsult23-Sep-09 5:12 
GeneralRe: Need help with updating SQL server express DB from c# - Done IT! Pin
Mark-12345678924-Sep-09 9:02
Mark-12345678924-Sep-09 9:02 
GeneralRe: Need help with updating SQL server express DB from c# - Done IT! Pin
PIEBALDconsult24-Sep-09 9:23
mvePIEBALDconsult24-Sep-09 9:23 
GeneralRe: Need help with updating SQL server express DB from c# - Done IT! Pin
Mark-12345678924-Sep-09 9:29
Mark-12345678924-Sep-09 9:29 
You wish is my command.

{
                  SqlConnection cn = new SqlConnection(LoginForm.gb_strConnection);
                  cn.Open();

   // this bit is me trying a work-around-----------------------------
                  char[] test = new char[15];
                  txbColPolicyRef.Text = txbColPolicyRef.Text.Trim().ToUpper();
                  int intLen = txbColPolicyRef.Text.Length;
                  if (intLen > 15) intLen = 15;
                  test = txbColPolicyRef.Text.Trim().ToUpper().Substring(0, intLen ).ToCharArray();
   // ------------------------------------------------------------
                  string strCommand = "INSERT INTO tblQLs (colQLID, colCreatedDate, colClosedDate, colErrDate, " +
                                                "colPolicyRef, colCreatedByUserID, colErrDescription, colErrByUserID, " +
                                                "colAppealReason, colAppealUpheld, colFinalActionTaken, colNotes, colUserTeam) " +
                                                "VALUES (" +
                                                "'16', " +
                                                "'x', " +
                                                "'" + test + "', " +
                                                "'" + @txbColCreatedByUserID.Text.Trim().ToUpper() + "', " +
                                                "'" + @cbColErrDescription.Text.Trim().ToUpper() + "', " +
                                                "'" + @txbColErrByUserID.Text.Trim().ToUpper() + "', " +
                                                "'x'," +
                                                "'" + @txbColErrDate.Text.Trim() + "', " +
                                                "'x','x','x','x', " +
                                                "'" + @txbColUserTeam.Text.Trim().ToUpper() + "') ";

                  SqlCommand cmd = new SqlCommand(strCommand);
                  cmd.Connection = cn;

                  cmd.ExecuteNonQuery();

                  cn.Close();
            }
GeneralRe: Need help with updating SQL server express DB from c# - Done IT! Pin
PIEBALDconsult24-Sep-09 9:44
mvePIEBALDconsult24-Sep-09 9:44 
Questionhow to make check of a value in a textbox is integer or string? Pin
bounik22-Sep-09 13:41
bounik22-Sep-09 13:41 
AnswerRe: how to make check of a value in a textbox is integer or string? Pin
Wes Aday22-Sep-09 13:44
professionalWes Aday22-Sep-09 13:44 
GeneralRe: how to make check of a value in a textbox is integer or string? Pin
bounik22-Sep-09 14:16
bounik22-Sep-09 14:16 
AnswerRe: how to make check of a value in a textbox is integer or string? Pin
Luc Pattyn22-Sep-09 14:16
sitebuilderLuc Pattyn22-Sep-09 14:16 
GeneralRe: how to make check of a value in a textbox is integer or string? Pin
bounik22-Sep-09 14:17
bounik22-Sep-09 14:17 
GeneralRe: how to make check of a value in a textbox is integer or string? Pin
jdhforever22-Sep-09 21:36
jdhforever22-Sep-09 21:36 
AnswerRe: how to make check of a value in a textbox is integer or string? Pin
PIEBALDconsult22-Sep-09 15:39
mvePIEBALDconsult22-Sep-09 15:39 
QuestionSerialization of objects IPHostEntry Pin
FJJCENTU22-Sep-09 12:55
FJJCENTU22-Sep-09 12:55 
Question[Message Deleted] Pin
Mark-12345678922-Sep-09 12:33
Mark-12345678922-Sep-09 12:33 
AnswerRe: Need help Updating SQL Express DB from c# :( Pin
PIEBALDconsult22-Sep-09 13:50
mvePIEBALDconsult22-Sep-09 13:50 
GeneralRe: Need help Updating SQL Express DB from c# :( Pin
Mark-12345678922-Sep-09 14:35
Mark-12345678922-Sep-09 14:35 
GeneralRe: Need help Updating SQL Express DB from c# :( Pin
PIEBALDconsult22-Sep-09 14:37
mvePIEBALDconsult22-Sep-09 14:37 
GeneralRe: Need help Updating SQL Express DB from c# :( Pin
Mark-12345678922-Sep-09 16:07
Mark-12345678922-Sep-09 16:07 
GeneralRe: Need help Updating SQL Express DB from c# :( Pin
PIEBALDconsult22-Sep-09 18:38
mvePIEBALDconsult22-Sep-09 18:38 
QuestionRepeat XML node Pin
kurangu22-Sep-09 9:48
kurangu22-Sep-09 9:48 
AnswerRe: Repeat XML node Pin
Richard MacCutchan22-Sep-09 10:01
mveRichard MacCutchan22-Sep-09 10:01 

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.