Click here to Skip to main content
15,879,474 members
Home / Discussions / C#
   

C#

 
QuestionHow to copy the Facebook photo arrangement functionality to local computer? Pin
biop.codeproject19-Dec-13 17:46
biop.codeproject19-Dec-13 17:46 
AnswerRe: How to copy the Facebook photo arrangement functionality to local computer? Pin
Mycroft Holmes19-Dec-13 19:01
professionalMycroft Holmes19-Dec-13 19:01 
Questionask messagebox with sum record Pin
Member 1027082519-Dec-13 16:58
Member 1027082519-Dec-13 16:58 
AnswerRe: ask messagebox with sum record Pin
Mycroft Holmes19-Dec-13 18:57
professionalMycroft Holmes19-Dec-13 18:57 
GeneralRe: ask messagebox with sum record Pin
Member 1027082519-Dec-13 19:41
Member 1027082519-Dec-13 19:41 
GeneralRe: ask messagebox with sum record Pin
Mycroft Holmes19-Dec-13 23:46
professionalMycroft Holmes19-Dec-13 23:46 
GeneralRe: ask messagebox with sum record Pin
Simon_Whale20-Dec-13 0:29
Simon_Whale20-Dec-13 0:29 
SuggestionRe: ask messagebox with sum record Pin
Richard Deeming20-Dec-13 2:03
mveRichard Deeming20-Dec-13 2:03 
Avoiding SQL Injection[^] isn't hard:

C#
string save = "Insert into ShippingCompany ([ShippingCompanyCode], [ShippingCompanyName], [CurenccyCode], [ActiveStatus], [CreateBy], [CreateDate], [modifiedBy], [modifiedDate]) "
                                 + "values (@ShippingCompanyCode, @ShippingCompanyName, @CurenccyCode, @ActiveStatus, @CreateBy, @CreateDate, @modifiedBy, @modifiedDate)";

using (SqlConnection con = new SqlConnection(dikonek))
using (SqlCommand cmd = new SqlCommand(save, con))
{
   cmd.Parameters.AddWithValue("@ShippingCompanyCode", t1.Text);
   cmd.Parameters.AddWithValue("@ShippingCompanyName", t2.Text);
   cmd.Parameters.AddWithValue("@CurenccyCode", t3.Text);
   cmd.Parameters.AddWithValue("@ActiveStatus", t4.Text);
   cmd.Parameters.AddWithValue("@CreateBy", t5.Text);
   cmd.Parameters.AddWithValue("@CreateDate", DateTime.Now);
   cmd.Parameters.AddWithValue("@modifiedBy", t7.Text);
   cmd.Parameters.AddWithValue("@modifiedDate", DateTime.Now);
   
   con.Open();
   int rowsAffected = cmd.ExecuteNonQuery();
   MessageBox.Show(string.Format("{0} rows affected.", rowsAffected));
}


You should also consider giving your controls more meaningful names than t1, t2, etc.



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


QuestionThis operation would create an incorrectly structured document. Pin
Jassim Rahma19-Dec-13 10:10
Jassim Rahma19-Dec-13 10:10 
AnswerRe: This operation would create an incorrectly structured document. Pin
Ravi Bhavnani19-Dec-13 10:49
professionalRavi Bhavnani19-Dec-13 10:49 
GeneralRe: This operation would create an incorrectly structured document. Pin
Manfred Rudolf Bihy19-Dec-13 12:22
professionalManfred Rudolf Bihy19-Dec-13 12:22 
GeneralRe: This operation would create an incorrectly structured document. Pin
Jassim Rahma19-Dec-13 22:13
Jassim Rahma19-Dec-13 22:13 
GeneralRe: This operation would create an incorrectly structured document. Pin
JV999919-Dec-13 22:58
professionalJV999919-Dec-13 22:58 
GeneralRe: This operation would create an incorrectly structured document. Pin
Richard Deeming20-Dec-13 1:55
mveRichard Deeming20-Dec-13 1:55 
AnswerRe: This operation would create an incorrectly structured document. Pin
Ravi Bhavnani20-Dec-13 2:10
professionalRavi Bhavnani20-Dec-13 2:10 
AnswerRe: This operation would create an incorrectly structured document. Pin
Ravi Bhavnani20-Dec-13 2:10
professionalRavi Bhavnani20-Dec-13 2:10 
GeneralRe: This operation would create an incorrectly structured document. Pin
Jassim Rahma20-Dec-13 2:15
Jassim Rahma20-Dec-13 2:15 
Questiondetermine if Google Drive is installed and what's its drive? Pin
Jassim Rahma19-Dec-13 7:28
Jassim Rahma19-Dec-13 7:28 
AnswerRe: determine if Google Drive is installed and what's its drive? Pin
Eddy Vluggen19-Dec-13 7:52
professionalEddy Vluggen19-Dec-13 7:52 
AnswerRe: determine if Google Drive is installed and what's its drive? Pin
BillWoodruff19-Dec-13 8:40
professionalBillWoodruff19-Dec-13 8:40 
QuestionIncrease performance of csv Pin
sjs4u19-Dec-13 2:46
sjs4u19-Dec-13 2:46 
AnswerRe: Increase performance of csv Pin
Dave Kreskowiak19-Dec-13 3:14
mveDave Kreskowiak19-Dec-13 3:14 
AnswerRe: Increase performance of csv Pin
BillWoodruff19-Dec-13 3:23
professionalBillWoodruff19-Dec-13 3:23 
AnswerRe: Increase performance of csv Pin
Ennis Ray Lynch, Jr.19-Dec-13 3:33
Ennis Ray Lynch, Jr.19-Dec-13 3:33 
SuggestionRe: Increase performance of csv Pin
Richard Deeming19-Dec-13 3:43
mveRichard Deeming19-Dec-13 3:43 

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.