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

C#

 
SuggestionRe: code for genetic algorithm Pin
Steve4419-Mar-13 15:04
Steve4419-Mar-13 15:04 
QuestionRunning .exe in windows form but it opens an external window Pin
Sachin k Rajput 17-Mar-13 21:03
Sachin k Rajput 17-Mar-13 21:03 
AnswerRe: Running .exe in windows form but it opens an external window Pin
Richard MacCutchan17-Mar-13 23:54
mveRichard MacCutchan17-Mar-13 23:54 
AnswerRe: Running .exe in windows form but it opens an external window Pin
Eddy Vluggen18-Mar-13 1:32
professionalEddy Vluggen18-Mar-13 1:32 
GeneralRe: Running .exe in windows form but it opens an external window Pin
Sachin k Rajput 18-Mar-13 3:29
Sachin k Rajput 18-Mar-13 3:29 
AnswerRe: Running .exe in windows form but it opens an external window Pin
Hari Om Prakash Sharma18-Mar-13 1:47
Hari Om Prakash Sharma18-Mar-13 1:47 
GeneralRe: Running .exe in windows form but it opens an external window Pin
Pete O'Hanlon18-Mar-13 1:55
mvePete O'Hanlon18-Mar-13 1:55 
GeneralRe: Running .exe in windows form but it opens an external window Pin
dusty_dex18-Mar-13 2:42
dusty_dex18-Mar-13 2:42 
GeneralRe: Running .exe in windows form but it opens an external window Pin
Pete O'Hanlon18-Mar-13 2:44
mvePete O'Hanlon18-Mar-13 2:44 
GeneralRe: Running .exe in windows form but it opens an external window Pin
dusty_dex18-Mar-13 2:55
dusty_dex18-Mar-13 2:55 
GeneralRe: Running .exe in windows form but it opens an external window Pin
Sachin k Rajput 18-Mar-13 3:28
Sachin k Rajput 18-Mar-13 3:28 
GeneralRe: Running .exe in windows form but it opens an external window Pin
dusty_dex18-Mar-13 5:07
dusty_dex18-Mar-13 5:07 
AnswerRe: Running .exe in windows form but it opens an external window Pin
Vasudevan Deepak Kumar18-Mar-13 9:12
Vasudevan Deepak Kumar18-Mar-13 9:12 
Questionwhat is the meaning of this? Syntax error in UPDATE statement. Pin
kruczynski12316-Mar-13 18:43
kruczynski12316-Mar-13 18:43 
AnswerRe: what is the meaning of this? Syntax error in UPDATE statement. Pin
PIEBALDconsult16-Mar-13 19:23
mvePIEBALDconsult16-Mar-13 19:23 
AnswerRe: what is the meaning of this? Syntax error in UPDATE statement. Pin
Richard MacCutchan16-Mar-13 22:11
mveRichard MacCutchan16-Mar-13 22:11 
AnswerRe: what is the meaning of this? Syntax error in UPDATE statement. Pin
OriginalGriff16-Mar-13 22:54
mveOriginalGriff16-Mar-13 22:54 
As Richard says, without your actual code and the UPDATE command istelf, we can't tell you exactly what the problem is.
An SQL update statement is similar to this:
SQL
UPDATE <table_name> SET <field>=<new value>,<field... WHERE <field>=<value>
So an example would be:
SQL
UPDATE myTable SET UserName='kruczynski123' WHERE UserID=9738136
So, check you have each section of it, or very similar, and check you have quotes where you need them. If you are using C# (and I assume you are) then try using Parametrized queries - they may help you (and you should use them anyway to prevent an SQL Injection attack accidentally of deliberately destroying your database). This may help:
C#
using (SqlConnection con = new SqlConnection(strConnect))
    {
    con.Open();
    using (SqlCommand com = new SqlCommand("UPDATE myTable SET myColumn1=@C1, myColumn2=@C2 WHERE Id=@ID", con))
        {
        com.Parameters.AddWithValue("@ID", id);
        com.Parameters.AddWithValue("@C1", myValueForColumn1);
        com.Parameters.AddWithValue("@C2", myValueForColumn2);
        com.ExecuteNonQuery();
        }
    }

The universe is composed of electrons, neutrons, protons and......morons. (ThePhantomUpvoter)

GeneralRe: what is the meaning of this? Syntax error in UPDATE statement. Pin
PIEBALDconsult17-Mar-13 10:45
mvePIEBALDconsult17-Mar-13 10:45 
AnswerRe: what is the meaning of this? Syntax error in UPDATE statement. Pin
Abhinav S18-Mar-13 6:37
Abhinav S18-Mar-13 6:37 
QuestionConnection between two forms in a project Pin
coolvibhu16-Mar-13 6:18
coolvibhu16-Mar-13 6:18 
AnswerRe: Connection between two forms in a project Pin
NotPolitcallyCorrect16-Mar-13 6:36
NotPolitcallyCorrect16-Mar-13 6:36 
AnswerRe: Connection between two forms in a project Pin
OriginalGriff16-Mar-13 6:40
mveOriginalGriff16-Mar-13 6:40 
QuestionListBox datasource is not updated on first click Pin
zulfakar16-Mar-13 3:24
zulfakar16-Mar-13 3:24 
AnswerRe: ListBox datasource is not updated on first click Pin
Jegan Thiyagesan16-Mar-13 13:31
Jegan Thiyagesan16-Mar-13 13:31 
GeneralRe: ListBox datasource is not updated on first click Pin
zulfakar17-Mar-13 8:24
zulfakar17-Mar-13 8:24 

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.