Click here to Skip to main content
15,881,715 members
Home / Discussions / C#
   

C#

 
QuestionIssues in Connecting to SQL Server Database (on other machine) with C# windows Application Pin
Mohan Subramani4-Feb-14 4:46
Mohan Subramani4-Feb-14 4:46 
AnswerRe: Issues in Connecting to SQL Server Database (on other machine) with C# windows Application Pin
Richard Deeming4-Feb-14 4:51
mveRichard Deeming4-Feb-14 4:51 
GeneralRe: Issues in Connecting to SQL Server Database (on other machine) with C# windows Application Pin
Mohan Subramani4-Feb-14 23:01
Mohan Subramani4-Feb-14 23:01 
GeneralRe: Issues in Connecting to SQL Server Database (on other machine) with C# windows Application Pin
Richard Deeming5-Feb-14 2:43
mveRichard Deeming5-Feb-14 2:43 
AnswerRe: Issues in Connecting to SQL Server Database (on other machine) with C# windows Application Pin
John D. Sanders4-Feb-14 9:11
John D. Sanders4-Feb-14 9:11 
QuestionExecution of query?? Pin
Member 105648504-Feb-14 0:42
Member 105648504-Feb-14 0:42 
AnswerRe: Execution of query?? Pin
BBatts4-Feb-14 1:40
BBatts4-Feb-14 1:40 
AnswerRe: Execution of query?? Pin
Richard Deeming4-Feb-14 2:54
mveRichard Deeming4-Feb-14 2:54 
Member 10564850 wrote:
My query can't executed successfully please help ??

As Griff mentioned on Saturday:
Just remember in future - the better the info you give us, the quicker we can give you a solution!

Once again, you've posted your code, but not the error message, which leaves us to play another game of "guess the error".



Assuming the problem is with the column names containing special characters, the quick fix is to wrap the affected column names in square brackets. You'll also need to fix the parameter names:
C#
string s = "INSERT INTO [Students Records] (Name, Age, Class, Gender, [Guardian's Name], [Contact.No], Address, [Email-Address]) VALUES(@Name, @Age, @Class, @Gender, @GuardiansName, @ContactNo, @Address, @EmailAddress)";

A better solution is to change your database structure so that the table and column names do not contain anything other than letters and numbers - no spaces, no punctuation, and no extended characters.

The same restrictions apply to parameter names.



If that doesn't solve the problem, then you'll need to provide the details of the exception being thrown when you try to execute the query.



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


GeneralRe: Execution of query?? Pin
Dave Kreskowiak4-Feb-14 4:25
mveDave Kreskowiak4-Feb-14 4:25 
AnswerRe: Execution of query?? Pin
Eddy Vluggen4-Feb-14 2:59
professionalEddy Vluggen4-Feb-14 2:59 
SuggestionRe: Execution of query?? Pin
thatraja4-Feb-14 3:19
professionalthatraja4-Feb-14 3:19 
AnswerRe: Execution of query?? Pin
Dave Kreskowiak4-Feb-14 4:26
mveDave Kreskowiak4-Feb-14 4:26 
AnswerRe: Execution of query?? Pin
Marco Bertschi5-Feb-14 0:16
protectorMarco Bertschi5-Feb-14 0:16 
Questionconvert MySQL UTC_TIMESTAMP() to user local time Pin
Jassim Rahma4-Feb-14 0:13
Jassim Rahma4-Feb-14 0:13 
AnswerRe: convert MySQL UTC_TIMESTAMP() to user local time Pin
Dave Kreskowiak4-Feb-14 4:21
mveDave Kreskowiak4-Feb-14 4:21 
QuestionSense of making my own Timestamp class? Pin
Marco Bertschi3-Feb-14 20:42
protectorMarco Bertschi3-Feb-14 20:42 
AnswerRe: Sense of making my own Timestamp class? Pin
V.3-Feb-14 21:26
professionalV.3-Feb-14 21:26 
GeneralRe: Sense of making my own Timestamp class? Pin
Marco Bertschi3-Feb-14 21:35
protectorMarco Bertschi3-Feb-14 21:35 
GeneralRe: Sense of making my own Timestamp class? Pin
BillWoodruff4-Feb-14 12:43
professionalBillWoodruff4-Feb-14 12:43 
GeneralRe: Sense of making my own Timestamp class? Pin
Dave Kreskowiak4-Feb-14 13:42
mveDave Kreskowiak4-Feb-14 13:42 
AnswerRe: Sense of making my own Timestamp class? Pin
BillWoodruff4-Feb-14 3:56
professionalBillWoodruff4-Feb-14 3:56 
GeneralRe: Sense of making my own Timestamp class? Pin
Marco Bertschi4-Feb-14 4:03
protectorMarco Bertschi4-Feb-14 4:03 
AnswerRe: Sense of making my own Timestamp class? Pin
jschell4-Feb-14 13:20
jschell4-Feb-14 13:20 
GeneralRe: Sense of making my own Timestamp class? Pin
Marco Bertschi4-Feb-14 20:07
protectorMarco Bertschi4-Feb-14 20:07 
AnswerRe: Sense of making my own Timestamp class? Pin
TnTinMn6-Feb-14 12:37
TnTinMn6-Feb-14 12:37 

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.