Click here to Skip to main content
15,887,477 members
Home / Discussions / C#
   

C#

 
GeneralRe: Translating an "error event" to a managed exception Pin
BobJanova5-Mar-14 5:46
BobJanova5-Mar-14 5:46 
AnswerRe: Translating an "error event" to a managed exception Pin
Shameel5-Mar-14 5:07
professionalShameel5-Mar-14 5:07 
AnswerRe: Translating an "error event" to a managed exception Pin
BobJanova5-Mar-14 5:53
BobJanova5-Mar-14 5:53 
AnswerExceptions are exceptional Pin
Ennis Ray Lynch, Jr.5-Mar-14 8:58
Ennis Ray Lynch, Jr.5-Mar-14 8:58 
AnswerRe: Translating an "error event" to a managed exception Pin
jschell5-Mar-14 9:41
jschell5-Mar-14 9:41 
GeneralRe: Translating an "error event" to a managed exception Pin
Bernhard Hiller5-Mar-14 20:17
Bernhard Hiller5-Mar-14 20:17 
QuestionPlease help me. don't working save button Pin
bayaa4-Mar-14 23:03
bayaa4-Mar-14 23:03 
SuggestionRe: Please help me. don't working save button Pin
Richard Deeming4-Mar-14 23:13
mveRichard Deeming4-Mar-14 23:13 
Start by fixing the SQL Injection vulnerability[^] in your code:
C#
private void btnSave_Click(object sender, EventArgs e)
{
    try
    {
        sc.Open();
        
        using (SqlCommand cmd = new SqlCommand("INSERT INTO emails (id, emails, pbid) VALUES (@id, @emails, @pbid)"))
        {
            cmd.Parameters.AddWithValue("@id", txtId.Text);
            cmd.Parameters.AddWithValue("@emails", txtEm.Text);
            cmd.Parameters.AddWithValue("@pbid", txtPbid.Text);
            cmd.ExecuteNonQuery();
            
            MessageBox.Show("Update Successfull to the database");
        }
    }
    catch (Exception ex)
    {
        MessageBox.Show(ex.Message);
        System.Diagnostics.Debug.WriteLine(ex);
    }
    finally
    {
        sc.Close();
    }
}


If it still doesn't work, you'll need to post the error message. Look in the debug output in Visual Studio to get the full details.



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralMessage Closed Pin
6-Mar-14 3:15
FesAlex6-Mar-14 3:15 
GeneralRe: Please help me. don't working save button Pin
Pete O'Hanlon6-Mar-14 3:32
mvePete O'Hanlon6-Mar-14 3:32 
GeneralRe: Please help me. don't working save button Pin
thatraja6-Mar-14 3:59
professionalthatraja6-Mar-14 3:59 
GeneralRe: Please help me. don't working save button Pin
bayaa6-Mar-14 16:09
bayaa6-Mar-14 16:09 
GeneralRe: Please help me. don't working save button Pin
bayaa6-Mar-14 16:10
bayaa6-Mar-14 16:10 
AnswerRe: Please help me. don't working save button Pin
Member 104046945-Mar-14 21:18
Member 104046945-Mar-14 21:18 
GeneralRe: Please help me. don't working save button Pin
bayaa6-Mar-14 15:55
bayaa6-Mar-14 15:55 
GeneralRe: Please help me. don't working save button Pin
bayaa6-Mar-14 19:29
bayaa6-Mar-14 19:29 
GeneralRe: Please help me. don't working save button Pin
bayaa6-Mar-14 19:52
bayaa6-Mar-14 19:52 
QuestionInheriting binding list Pin
Gilbert Consellado4-Mar-14 21:52
professionalGilbert Consellado4-Mar-14 21:52 
AnswerRe: Inheriting binding list Pin
BobJanova5-Mar-14 0:56
BobJanova5-Mar-14 0:56 
GeneralRe: Inheriting binding list Pin
Gilbert Consellado5-Mar-14 22:19
professionalGilbert Consellado5-Mar-14 22:19 
GeneralRe: Inheriting binding list Pin
Gilbert Consellado5-Mar-14 22:42
professionalGilbert Consellado5-Mar-14 22:42 
GeneralRe: Inheriting binding list Pin
BobJanova6-Mar-14 6:10
BobJanova6-Mar-14 6:10 
GeneralRe: Inheriting binding list Pin
Gilbert Consellado6-Mar-14 22:05
professionalGilbert Consellado6-Mar-14 22:05 
AnswerRe: Inheriting binding list Pin
Eddy Vluggen6-Mar-14 7:10
professionalEddy Vluggen6-Mar-14 7:10 
GeneralRe: Inheriting binding list Pin
Gilbert Consellado6-Mar-14 22:25
professionalGilbert Consellado6-Mar-14 22:25 

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.