Click here to Skip to main content
15,888,610 members
Home / Discussions / C#
   

C#

 
GeneralRe: callback function only getting called once then program crashing Pin
rjs1 431-Dec-09 7:26
rjs1 431-Dec-09 7:26 
QuestionIs it possible to create a COM Component based on a .Net Component developed from the Compact Framework, running on Windows CE 4.2? Pin
pdohara31-Dec-09 4:25
pdohara31-Dec-09 4:25 
AnswerRe: Is it possible to create a COM Component based on a .Net Component developed from the Compact Framework, running on Windows CE 4.2? Pin
#realJSOP31-Dec-09 9:14
mve#realJSOP31-Dec-09 9:14 
QuestionAS Pin
manirul0431-Dec-09 4:23
manirul0431-Dec-09 4:23 
AnswerOM Pin
Keith Barrow31-Dec-09 4:27
professionalKeith Barrow31-Dec-09 4:27 
GeneralRe: OM Pin
OriginalGriff31-Dec-09 4:40
mveOriginalGriff31-Dec-09 4:40 
GeneralRe: OM Pin
PIEBALDconsult31-Dec-09 14:31
mvePIEBALDconsult31-Dec-09 14:31 
Questionsomething wrong in codes Pin
Erdinc2731-Dec-09 3:27
Erdinc2731-Dec-09 3:27 
hi coders
i have a problem about my codes
let me tell the scenario first...i have two Forms(frm1 and frm2)...i opened frm2 by clicking a button on frm1..there is no problem till here...i want to save informations by filling the blanks on frm2 and save it but when i click save button there is nothing happen..here are my codes.. i couldnt see anything wrong in my connection or in my insert command...i need help about it

try
{
con = new SqlConnection("data source=Erdal2\\SQLEXPRESS;initial catalog=Medya;integrated security=true");

cmd = new SqlCommand("insert into Rehber (ad,soyad,firma,sektor,grup,cep_no,is_no,ev_no,fax,mail,web,msn,skype,dgm_tarih,adres,ilce,sehir,vergi_no,vrgi_daire) values (@ad,@soyad,@firma,@sektor,@grup,@cep_no,@is_no,@ev_no,@fax,@mail,@web,@msn,@skype,@dgm_tarih,@adres,@ilce,@sehir,@vergi_no,@vrgi_daire)", con);

con.Open();

cmd.Parameters.Add("@ad", SqlDbType.NVarChar).Value = txtAd.Text;
cmd.Parameters.Add("@soyad", SqlDbType.NVarChar).Value = txtSoyad.Text;
cmd.Parameters.Add("@firma", SqlDbType.NVarChar).Value = cmbFirma.SelectedItem;
cmd.Parameters.Add("@sektor", SqlDbType.NVarChar).Value = cmbSektor.SelectedItem;
cmd.Parameters.Add("@grup", SqlDbType.NVarChar).Value = txtGrup.Text;
cmd.Parameters.Add("@cep_no", SqlDbType.NVarChar).Value = txtCep.Text;
cmd.Parameters.Add("@is_no", SqlDbType.NVarChar).Value = txtisTlf.Text;
cmd.Parameters.Add("@ev_no", SqlDbType.NVarChar).Value = txtEvTlf.Text;
cmd.Parameters.Add("@fax", SqlDbType.NVarChar).Value = txtFax.Text;
cmd.Parameters.Add("@mail", SqlDbType.NVarChar).Value = txtMail.Text;
cmd.Parameters.Add("@web", SqlDbType.NVarChar).Value = txtURL.Text;
cmd.Parameters.Add("@msn", SqlDbType.NVarChar).Value = txtMSn.Text;
cmd.Parameters.Add("@skype", SqlDbType.NVarChar).Value = txtSkype.Text;
cmd.Parameters.Add("@dgm_tarih", SqlDbType.SmallDateTime).Value = dateTimePicker1.Value;
cmd.Parameters.Add("@adres", SqlDbType.NVarChar).Value = txtAdres.Text;
cmd.Parameters.Add("@ilce", SqlDbType.NVarChar).Value = txtIlce.Text;
cmd.Parameters.Add("@sehir", SqlDbType.NVarChar).Value = txtSehir.Text;
cmd.Parameters.Add("@vergi_no", SqlDbType.NVarChar).Value = txtVergiNo.Text;
cmd.Parameters.Add("@vrgi_daire", SqlDbType.NVarChar).Value = txtVergiDaire.Text;

if ((txtAd.Text != "") || (txtSoyad.Text != ""))
{
if (cmd.ExecuteNonQuery() == 1)

MessageBox.Show("Done", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
else
MessageBox.Show("Error during saving processes","Warning", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
else
MessageBox.Show("There must be name and surname entered","warning",MessageBoxButtons.OK,MessageBoxIcon.Error);

i declared con and cmd as global variables...
AnswerRe: something wrong in codes Pin
OriginalGriff31-Dec-09 3:54
mveOriginalGriff31-Dec-09 3:54 
GeneralRe: something wrong in codes Pin
Erdinc2731-Dec-09 4:28
Erdinc2731-Dec-09 4:28 
GeneralRe: something wrong in codes Pin
OriginalGriff31-Dec-09 4:39
mveOriginalGriff31-Dec-09 4:39 
GeneralRe: something wrong in codes Pin
Erdinc271-Jan-10 23:44
Erdinc271-Jan-10 23:44 
GeneralRe: something wrong in codes Pin
OriginalGriff2-Jan-10 0:02
mveOriginalGriff2-Jan-10 0:02 
QuestionRetrieve an image from another pc in network Pin
wasifmuneer31-Dec-09 1:54
wasifmuneer31-Dec-09 1:54 
AnswerRe: Retrieve an image from another pc in network Pin
Paul Unsworth31-Dec-09 2:06
Paul Unsworth31-Dec-09 2:06 
AnswerRe: Retrieve an image from another pc in network Pin
minnie mouse31-Dec-09 14:48
minnie mouse31-Dec-09 14:48 
Questionproblem with custom serialization in .net 2.0 Pin
prasadbuddhika31-Dec-09 1:48
prasadbuddhika31-Dec-09 1:48 
AnswerRe: problem with custom serialization in .net 2.0 Pin
Paul Unsworth31-Dec-09 2:00
Paul Unsworth31-Dec-09 2:00 
AnswerRe: problem with custom serialization in .net 2.0 Pin
Abhinav S31-Dec-09 3:14
Abhinav S31-Dec-09 3:14 
GeneralRe: problem with custom serialization in .net 2.0 Pin
prasadbuddhika31-Dec-09 19:14
prasadbuddhika31-Dec-09 19:14 
Question"The path is not of a legal form." on trying to start the service created in c# Pin
sri_346431-Dec-09 0:25
sri_346431-Dec-09 0:25 
AnswerRe: "The path is not of a legal form." on trying to start the service created in c# Pin
Rob Philpott31-Dec-09 0:42
Rob Philpott31-Dec-09 0:42 
AnswerRe: "The path is not of a legal form." on trying to start the service created in c# Pin
Keith Barrow31-Dec-09 0:46
professionalKeith Barrow31-Dec-09 0:46 
GeneralRe: "The path is not of a legal form." on trying to start the service created in c# Pin
sri_346431-Dec-09 0:52
sri_346431-Dec-09 0:52 
GeneralRe: "The path is not of a legal form." on trying to start the service created in c# Pin
Keith Barrow31-Dec-09 1:09
professionalKeith Barrow31-Dec-09 1:09 

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.