Click here to Skip to main content
15,868,340 members
Home / Discussions / C#
   

C#

 
PinnedHOW TO ANSWER A QUESTION PinPopular
Chris Maunder12-Jul-09 22:36
cofounderChris Maunder12-Jul-09 22:36 
PinnedHow to get an answer to your question Pin
Chris Maunder10-Nov-05 16:31
cofounderChris Maunder10-Nov-05 16:31 
QuestionIParsable? IFormattable? ICustomFormatter? IFormatProvider? TryParse! ToString! Pin
Tracy Dryden24-Mar-24 12:29
Tracy Dryden24-Mar-24 12:29 
AnswerRe: IParsable? IFormattable? ICustomFormatter? IFormatProvider? TryParse! ToString! Pin
Mycroft Holmes24-Mar-24 15:07
professionalMycroft Holmes24-Mar-24 15:07 
GeneralRe: IParsable? IFormattable? ICustomFormatter? IFormatProvider? TryParse! ToString! Pin
Tracy Dryden24-Mar-24 16:19
Tracy Dryden24-Mar-24 16:19 
AnswerRe: IParsable? IFormattable? ICustomFormatter? IFormatProvider? TryParse! ToString! Pin
Ralf Meier24-Mar-24 22:35
professionalRalf Meier24-Mar-24 22:35 
GeneralRe: IParsable? IFormattable? ICustomFormatter? IFormatProvider? TryParse! ToString! Pin
Tracy Dryden25-Mar-24 7:51
Tracy Dryden25-Mar-24 7:51 
AnswerRe: IParsable? IFormattable? ICustomFormatter? IFormatProvider? TryParse! ToString! Pin
jschell26-Mar-24 12:00
jschell26-Mar-24 12:00 
Rant(Current) AI Rant. Pin
Gerry Schmitz17-Mar-24 12:29
mveGerry Schmitz17-Mar-24 12:29 
GeneralRe: (Current) AI Rant. Pin
Eddy Vluggen26-Mar-24 5:34
professionalEddy Vluggen26-Mar-24 5:34 
QuestionMessageBox Appearing Behind Window Pin
Richard Andrew x6417-Mar-24 1:27
professionalRichard Andrew x6417-Mar-24 1:27 
AnswerRe: MessageBox Appearing Behind Window Pin
OriginalGriff17-Mar-24 4:33
mveOriginalGriff17-Mar-24 4:33 
AnswerRe: MessageBox Appearing Behind Window Pin
Gerry Schmitz17-Mar-24 6:37
mveGerry Schmitz17-Mar-24 6:37 
GeneralRe: MessageBox Appearing Behind Window Pin
Richard Andrew x6417-Mar-24 8:04
professionalRichard Andrew x6417-Mar-24 8:04 
GeneralRe: MessageBox Appearing Behind Window Pin
Gerry Schmitz17-Mar-24 10:09
mveGerry Schmitz17-Mar-24 10:09 
AnswerRe: MessageBox Appearing Behind Window Pin
#realJSOP19-Mar-24 2:12
mve#realJSOP19-Mar-24 2:12 
QuestionUpdating sql table where textbox = ID Pin
cencom0116-Mar-24 6:51
cencom0116-Mar-24 6:51 
AnswerRe: Updating sql table where textbox = ID Pin
Dave Kreskowiak16-Mar-24 7:05
mveDave Kreskowiak16-Mar-24 7:05 
So little code and so many problems.

You never said what the error message was, but a quick glance shows this little gem:
C#
con.Close();
cmd.ExecuteNonQuery();

Why would you close the connection to the database and then try to tell it to execute your query?

And then look at your query.
C#
Update [Law_Responses] SET (Calltaker=@Calltaker, Date=@Date, City=@City, County=@County, Address=@Address) where TextBox171.text=@ID

How would your SQL server know anything at all about a TextBox in your app? It doesn't have any access to the controls in your app at all, let alone it's Text property, and it's very improbable that you have a column in your table called "Textbox171.text".

Since you're using parameters to pass values to the query already, I find it odd that you're trying, and failing, to use string concatentation to pass the value of a textbox to the query. The @ID value should also be passed as a parameter to the query.

You should also be giving your control names meaningful names and not accepting the default names in the designer. Given that this textbox is numbered 171, it seems you have a lot of work to do to make your code readable, understandable, debuggable, and supportable.

AnswerRe: Updating sql table where textbox = ID Pin
Richard Deeming17-Mar-24 23:37
mveRichard Deeming17-Mar-24 23:37 
QuestionCreating a shortcut (LNK) Pin
Richard Andrew x6416-Mar-24 3:38
professionalRichard Andrew x6416-Mar-24 3:38 
AnswerRe: Creating a shortcut (LNK) Pin
Dave Kreskowiak16-Mar-24 4:50
mveDave Kreskowiak16-Mar-24 4:50 
GeneralRe: Creating a shortcut (LNK) Pin
Richard Andrew x6416-Mar-24 7:23
professionalRichard Andrew x6416-Mar-24 7:23 
GeneralRe: Creating a shortcut (LNK) Pin
Dave Kreskowiak16-Mar-24 11:44
mveDave Kreskowiak16-Mar-24 11:44 
QuestionHow to read and update existing language MST file (1033.mst) which is part of MSI Package using C# application? Pin
krish8812-Mar-24 20:02
krish8812-Mar-24 20:02 
AnswerRe: How to read and update existing language MST file (1033.mst) which is part of MSI Package using C# application? Pin
OriginalGriff12-Mar-24 20:02
mveOriginalGriff12-Mar-24 20:02 

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.