Click here to Skip to main content
15,896,111 members
Home / Discussions / C#
   

C#

 
AnswerRe: FileSystemWatcher class Pin
Giorgi Dalakishvili24-May-08 1:06
mentorGiorgi Dalakishvili24-May-08 1:06 
GeneralRe: FileSystemWatcher class Pin
Bambor24-May-08 5:15
Bambor24-May-08 5:15 
Questionwierd problem Pin
the pink jedi24-May-08 0:53
the pink jedi24-May-08 0:53 
AnswerRe: wierd problem Pin
the pink jedi24-May-08 1:18
the pink jedi24-May-08 1:18 
Questionmakeing mobile themes Pin
omar el halwagy24-May-08 0:03
omar el halwagy24-May-08 0:03 
Questionlistview. Pin
angels77723-May-08 23:45
angels77723-May-08 23:45 
AnswerRe: listview. Pin
DaveyM6924-May-08 0:26
professionalDaveyM6924-May-08 0:26 
GeneralRe: listview. Pin
angels77724-May-08 21:26
angels77724-May-08 21:26 
hi.. sorry.. i think i would like to use up the DataGridView called dvCustomer
under
private void dvCustomer_SelectionChanged(object sender, EventArgs e)
{
}

when i click on the datagridview row... i would like to get the user ID from database. so that i can do the update as below ..



private void cust_update_Click(object sender, EventArgs e)
        {        
            bool success;
            success = dataAccess.AddCustomer(<big>Datagridview ID</big>, cust_name.Text, cust_add.Text, cust_account.Text, cust_phone.Text...);
            if (success)
            {
                MessageBox.Show("Data updated!");
            }
            else
            {
                MessageBox.Show("Update FAIL!!!");
            }
        }


in my dataAccess class

public bool AddCustomer(string function, string custName, string custAdd, string custAcc, string custPhone.....)
        {
            bool success = false;
            string query = string.Empty;
            try
            {
                SqlCommand cmd = new SqlCommand();
                cmd.Parameters.Add(new SqlParameter("@companyName", custName));
                cmd.Parameters.Add(new SqlParameter("@customerAdd", custAdd));
                cmd.Parameters.Add(new SqlParameter("@attName", custAdd));
                cmd.Parameters.Add(new SqlParameter("@customerAcc", custAcc));
                cmd.Parameters.Add(new SqlParameter("@customerPhone", custPhone));

 query += "UPDATE CUSTOMER set company_name= @companyName, company_add= @customerAdd, att_name= @attName, account_num= @customerAcc, phone= @customerPhone...........";
 query += " where cust_id =   <big>??????????</big>   ";
              
                cmd.CommandText = query;

                if (cn.State == ConnectionState.Closed) cn.Open();
                cmd.Connection = cn;

                if (cmd.ExecuteNonQuery() > 0)
                {
                    success = true;
                    return success;
                }

GeneralRe: listview. Pin
angels77724-May-08 21:28
angels77724-May-08 21:28 
GeneralRe: listview. Pin
DaveyM6925-May-08 9:54
professionalDaveyM6925-May-08 9:54 
Questionwindows service - timer [modified] Pin
tai-fun23-May-08 23:24
tai-fun23-May-08 23:24 
AnswerRe: windows service - timer Pin
Giorgi Dalakishvili24-May-08 0:59
mentorGiorgi Dalakishvili24-May-08 0:59 
QuestionApplication.Exit();, Environment.Exit(0); or this.Close(); Pin
Vandretta23-May-08 23:23
Vandretta23-May-08 23:23 
AnswerRe: Application.Exit();, Environment.Exit(0); or this.Close(); Pin
Giorgi Dalakishvili24-May-08 1:02
mentorGiorgi Dalakishvili24-May-08 1:02 
AnswerRe: Application.Exit();, Environment.Exit(0); or this.Close(); Pin
PIEBALDconsult24-May-08 3:35
mvePIEBALDconsult24-May-08 3:35 
GeneralRe: Application.Exit();, Environment.Exit(0); or this.Close(); Pin
Vandretta24-May-08 16:05
Vandretta24-May-08 16:05 
QuestionMocking objects Pin
N a v a n e e t h23-May-08 21:53
N a v a n e e t h23-May-08 21:53 
AnswerRe: Mocking objects Pin
Colin Angus Mackay23-May-08 23:22
Colin Angus Mackay23-May-08 23:22 
GeneralRe: Mocking objects Pin
N a v a n e e t h24-May-08 7:22
N a v a n e e t h24-May-08 7:22 
GeneralRe: Mocking objects Pin
Colin Angus Mackay24-May-08 8:49
Colin Angus Mackay24-May-08 8:49 
GeneralRe: Mocking objects Pin
N a v a n e e t h24-May-08 9:02
N a v a n e e t h24-May-08 9:02 
GeneralRe: Mocking objects Pin
Colin Angus Mackay24-May-08 9:31
Colin Angus Mackay24-May-08 9:31 
GeneralRe: Mocking objects Pin
N a v a n e e t h24-May-08 18:13
N a v a n e e t h24-May-08 18:13 
GeneralRe: Mocking objects Pin
Colin Angus Mackay24-May-08 22:57
Colin Angus Mackay24-May-08 22:57 
GeneralRe: Mocking objects Pin
N a v a n e e t h25-May-08 7:03
N a v a n e e t h25-May-08 7:03 

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.