Click here to Skip to main content
15,899,313 members
Home / Discussions / C#
   

C#

 
GeneralRe: async and await concept Pin
Pete O'Hanlon28-Sep-15 21:16
mvePete O'Hanlon28-Sep-15 21:16 
GeneralRe: async and await concept Pin
Anil Sharma198328-Sep-15 21:26
professionalAnil Sharma198328-Sep-15 21:26 
AnswerRe: async and await concept Pin
Agent__00728-Sep-15 23:19
professionalAgent__00728-Sep-15 23:19 
AnswerRe: async and await concept Pin
F-ES Sitecore29-Sep-15 1:02
professionalF-ES Sitecore29-Sep-15 1:02 
SuggestionRe: async and await concept Pin
Richard Deeming29-Sep-15 2:14
mveRichard Deeming29-Sep-15 2:14 
Questiongrid control, tile view Pin
Member 1201862628-Sep-15 20:00
Member 1201862628-Sep-15 20:00 
AnswerRe: grid control, tile view Pin
OriginalGriff28-Sep-15 20:11
mveOriginalGriff28-Sep-15 20:11 
QuestionWhy can I save the error information into the table of SQL server ? Pin
Member 245846728-Sep-15 17:40
Member 245846728-Sep-15 17:40 
Why I can not save the error information in the table: TABERRORINFO. Suppose I have two: TABCUSTOMER and TABERRORINFO.

private void cmdSave_Click(object sender, EventArgs e)
{
strSQL = "INSERT INTO TABCUSTOMER(IDCUSTOMER, FULLNAME, ADDRESS, IMAGE) " +
"VALUES (@IDCUSTOME, @FULLNAME, @ADDRESS, @ImageData);";

SqlCommand cmd = new SqlCommand(strSQL, ClsConnection.objConnect);
try
{
cmd.Parameters.AddWithValue("@IDCUSTOMER", txtIDCustomer.Text);
cmd.Parameters.AddWithValue("@FULLNAME", txtFullName.Text);
cmd.Parameters.AddWithValue("@ADDRESS", txtAddress.Text);

//byte[] ImageData = ReadFile(sPath);
cmd.Parameters.Add(new SqlParameter("@ImageData", (object)ImageData));
    if (ClsConnection.objConnect.State != System.Data.ConnectionState.Open)
    {
        ClsConnection.objConnect.Open();
    }
    cmd.CommandType = CommandType.Text;
    cmd.ExecuteNonQuery();
    // Close database
    ClsConnection.objConnect.Close();
}
catch (SqlException ex)
{
    ClsConnection.objConnect.Close();
    string sConError = "Save Messager Customer 1: " + ex.Message;
    SaveMessageErrSQL(sConError, strSQL);
}

}

private void SaveMessageErrSQL(string MessErr, string SqlErr)
{

string sSQL = "UPDATE TABERRORINFO SET ";
sSQL = sSQL + " ERRDATE = @NgayErr";
sSQL = sSQL + ", ERRMESSAGE = @MesaErr";
sSQL = sSQL + ", ERRSQL = @SQLErr";
sSQL = sSQL + " WHERE USERNAME = N'" + sUSERNAME + "';";
Debug.Print(sSQL);
    SqlCommand cmd = new SqlCommand(sSQL, objConnect);
    try
    {
        cmd.Parameters.AddWithValue("@NgayErr", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
        cmd.Parameters.AddWithValue("@MesaErr", MessErr);
        cmd.Parameters.AddWithValue("@SQLErr", SqlErr);
        cmd.CommandType = CommandType.Text;
        cmd.ExecuteNonQuery();
        objConnect.Close();
        DevExpress.XtraEditors.XtraMessageBox.Show("Saved" + MessErr);
    }
    catch (SqlException ex)
    {<br />
        objConnect.Close();
        //MessageBox.Show("SaveMessageErrSQL lỗi: " + sSQL);
        MessageBox.Show("No Save Message Errer into SQL: " + ex.Message);
    }

}

AnswerRe: Why can I save the error information into the table of SQL server ? Pin
Wendelius28-Sep-15 17:57
mentorWendelius28-Sep-15 17:57 
GeneralRe: Why can I save the error information into the table of SQL server ? Pin
Member 245846729-Sep-15 17:36
Member 245846729-Sep-15 17:36 
GeneralRe: Why can I save the error information into the table of SQL server ? Pin
Wendelius29-Sep-15 18:15
mentorWendelius29-Sep-15 18:15 
GeneralRe: Why can I save the error information into the table of SQL server ? Pin
Member 24584672-Oct-15 2:56
Member 24584672-Oct-15 2:56 
QuestionSitemapnode(breadcrumb) value changes with multiple users Pin
nitin_ion28-Sep-15 4:09
nitin_ion28-Sep-15 4:09 
AnswerRe: Sitemapnode(breadcrumb) value changes with multiple users Pin
Pete O'Hanlon28-Sep-15 4:58
mvePete O'Hanlon28-Sep-15 4:58 
AnswerRe: Sitemapnode(breadcrumb) value changes with multiple users Pin
Richard Deeming28-Sep-15 6:30
mveRichard Deeming28-Sep-15 6:30 
QuestionPort some C++ code which contains WriteFile to C# Pin
Member 1206160028-Sep-15 1:48
Member 1206160028-Sep-15 1:48 
AnswerRe: WriteFile equivalent in C# Pin
Pete O'Hanlon28-Sep-15 3:00
mvePete O'Hanlon28-Sep-15 3:00 
GeneralRe: WriteFile equivalent in C# Pin
Member 1206160028-Sep-15 3:18
Member 1206160028-Sep-15 3:18 
GeneralRe: WriteFile equivalent in C# Pin
Member 1206160028-Sep-15 3:21
Member 1206160028-Sep-15 3:21 
GeneralRe: WriteFile equivalent in C# Pin
Dave Kreskowiak28-Sep-15 3:40
mveDave Kreskowiak28-Sep-15 3:40 
GeneralRe: WriteFile equivalent in C# Pin
Member 1206160028-Sep-15 3:55
Member 1206160028-Sep-15 3:55 
GeneralRe: WriteFile equivalent in C# Pin
Dave Kreskowiak28-Sep-15 4:09
mveDave Kreskowiak28-Sep-15 4:09 
GeneralRe: WriteFile equivalent in C# Pin
Member 1206160028-Sep-15 4:15
Member 1206160028-Sep-15 4:15 
GeneralRe: WriteFile equivalent in C# Pin
Dave Kreskowiak28-Sep-15 4:25
mveDave Kreskowiak28-Sep-15 4:25 
GeneralRe: WriteFile equivalent in C# Pin
Member 1206160028-Sep-15 4:32
Member 1206160028-Sep-15 4:32 

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.