Click here to Skip to main content
15,914,387 members
Home / Discussions / C#
   

C#

 
AnswerRe: C# windows application Pin
Nader Elshehabi28-Jun-06 1:15
Nader Elshehabi28-Jun-06 1:15 
AnswerRe: C# windows application Pin
stancrm28-Jun-06 1:30
stancrm28-Jun-06 1:30 
Questiona few question about process management ? Pin
cmpeng3428-Jun-06 0:49
cmpeng3428-Jun-06 0:49 
AnswerRe: a few question about process management ? Pin
Nader Elshehabi28-Jun-06 1:28
Nader Elshehabi28-Jun-06 1:28 
QuestionC# ActiveX in CAB Pin
gnjunge27-Jun-06 23:42
gnjunge27-Jun-06 23:42 
QuestionCould sombody help clean up awfull code [modified] Pin
johan313127-Jun-06 23:33
johan313127-Jun-06 23:33 
QuestionCompact framework drawing Pin
os0027-Jun-06 23:30
os0027-Jun-06 23:30 
QuestionCreate folder Pin
SysJey27-Jun-06 22:37
SysJey27-Jun-06 22:37 
AnswerRe: Create folder Pin
Robert Rohde27-Jun-06 22:57
Robert Rohde27-Jun-06 22:57 
AnswerRe: Create folder Pin
Reza Raad28-Jun-06 0:16
Reza Raad28-Jun-06 0:16 
GeneralRe: Create folder Pin
SysJey28-Jun-06 22:26
SysJey28-Jun-06 22:26 
GeneralRe: Create folder Pin
Robert Rohde29-Jun-06 4:19
Robert Rohde29-Jun-06 4:19 
QuestionBluetooth Pin
ah_jiang_927-Jun-06 21:43
ah_jiang_927-Jun-06 21:43 
AnswerRe: Bluetooth Pin
Gavin Roberts27-Jun-06 23:16
Gavin Roberts27-Jun-06 23:16 
QuestionDataGrid and DataGridView Pin
Alamzeb khan27-Jun-06 21:32
Alamzeb khan27-Jun-06 21:32 
AnswerRe: DataGrid and DataGridView Pin
Robert Rohde27-Jun-06 23:03
Robert Rohde27-Jun-06 23:03 
GeneralRe: DataGrid and DataGridView Pin
Alamzeb khan28-Jun-06 0:38
Alamzeb khan28-Jun-06 0:38 
GeneralRe: DataGrid and DataGridView Pin
Robert Rohde28-Jun-06 1:29
Robert Rohde28-Jun-06 1:29 
Questionneed to insert name in the database using method Pin
Mamphekgo27-Jun-06 20:30
Mamphekgo27-Jun-06 20:30 
hi.i am struggling to insert name in the database using method.it gives me this error "Use of unassigned local variable 'empname'" and my code is as follows.


public void InsertValues(string empname1)
{

SqlConnection conn = new SqlConnection();
conn.ConnectionString = "integrated security=SSPI;initial catalog=Employee;server = za211149;persist security info=False";

conn.Open();

try
{
SqlCommand cmdInsert = new SqlCommand();
cmdInsert.Connection = conn;
empname = empname1;
cmdInsert.CommandText = "INSERT INTO jakes VALUES(@empname)";

cmdInsert.Parameters.Add(new SqlParameter("@empname",System.Data.SqlDbType.VarChar,50,"empname"));

cmdInsert.Parameters["@empname"].Value = empname.ToString();


if (cmdInsert.ExecuteNonQuery() !=0)
{
MessageBox.Show("Record inserted");
}
else
{
MessageBox.Show("record not inserted");
}
//return true;
}
catch(Exception E)
{

MessageBox.Show(E.ToString());
//return false;

}
finally
{
conn.Close();

}
}


AnswerRe: need to insert name in the database using method Pin
led mike27-Jun-06 20:44
led mike27-Jun-06 20:44 
GeneralRe: need to insert name in the database using method Pin
Mamphekgo27-Jun-06 21:12
Mamphekgo27-Jun-06 21:12 
GeneralRe: need to insert name in the database using method Pin
Mairaaj Khan27-Jun-06 22:32
professionalMairaaj Khan27-Jun-06 22:32 
GeneralRe: need to insert name in the database using method Pin
Michael P Butler28-Jun-06 1:56
Michael P Butler28-Jun-06 1:56 
GeneralRe: need to insert name in the database using method Pin
Mairaaj Khan28-Jun-06 3:33
professionalMairaaj Khan28-Jun-06 3:33 
QuestionMoving Toolstrip Like Toolstrip in MS Products Pin
praveenqwe27-Jun-06 20:12
praveenqwe27-Jun-06 20:12 

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.