Click here to Skip to main content
15,886,362 members
Home / Discussions / C#
   

C#

 
GeneralRe: Skins in C# Pin
vivasaayi22-Sep-09 20:33
vivasaayi22-Sep-09 20:33 
GeneralRe: Skins in C# Pin
egenis22-Sep-09 20:36
egenis22-Sep-09 20:36 
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 
Thank you you help, below is the working code.
I am sure there will be smart ways to do this, but I am just happy to get it working.

The next problem (just incase you can help) is, is in another bit of code I use Textbox.text instead of the dr[col..], however the string is too long for the field and i get an error. even when i use substring(0,10). How can I auto sence the max field width and truncate it.

also (as i have you here) i would like to apply some formating to a cell on a DataViewGrid ie date dd/mm/yyyy.


            private void btnSaveAllChangesMadeToAllLogsSoFar_Click(object sender, EventArgs e)
            {
              
                  SqlConnection cn = new SqlConnection(LoginForm.gb_strConnection);
                  cn.Open();

                  DataTable dt = new DataTable();
                  dt = gl_Dataset.ds.Tables["tblQls"];
                  string strCommand = "";

                  foreach (DataRow dr in dt.Rows)
                  {
                        strCommand = "UPDATE tblQLs SET " +
                              "colClosedDate = '" + dr["colClosedDate"].ToString() + "', " +
                              "colAppealReason = '" + dr["colAppealReason"].ToString() + "', " +
                              "colAppealUpheld = '" + dr["colAppealUpheld"].ToString() + "', " +
                              "colFinalActionTaken = '" + dr["colFinalActionTaken"].ToString() + "', " +
                              "colNotes = '" + dr["colNotes"].ToString() + "' " +
                              "WHERE [colErrByUserID] = '" + dr["colErrByUserID"].ToString() + "' " +
                              "AND [colQLID] = '" + dr["colQLID"].ToString() + "' ";

                        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: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 
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 

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.