Click here to Skip to main content
15,851,319 members
Home / Discussions / Database
   

Database

 
QuestionHow can i remove duplicate item from combobox with datasource? Pin
Member 1051522510-Sep-15 3:51
professionalMember 1051522510-Sep-15 3:51 
AnswerRe: How can i remove duplicate item from combobox with datasource? Pin
Eddy Vluggen10-Sep-15 4:28
professionalEddy Vluggen10-Sep-15 4:28 
QuestionMemSQL.. Explored yet? Pin
Schatak8-Sep-15 22:02
professionalSchatak8-Sep-15 22:02 
AnswerRe: MemSQL.. Explored yet? Pin
Eddy Vluggen9-Sep-15 0:20
professionalEddy Vluggen9-Sep-15 0:20 
AnswerRe: MemSQL.. Explored yet? Pin
Kornfeld Eliyahu Peter9-Sep-15 0:51
professionalKornfeld Eliyahu Peter9-Sep-15 0:51 
GeneralRe: MemSQL.. Explored yet? Pin
Schatak9-Sep-15 22:39
professionalSchatak9-Sep-15 22:39 
AnswerRe: MemSQL.. Explored yet? Pin
jschell11-Sep-15 13:14
jschell11-Sep-15 13:14 
QuestionC# DELETE FROM Parameter problem Pin
Magnus Vinterhav6-Sep-15 3:06
Magnus Vinterhav6-Sep-15 3:06 
Hi.

I have a local db with a number of tables. One is a table with filenames. This method is supposed to remove the file from the database table HiddenFile with the id sent to the method.
I have been trying to solve this for a long time without success.

The code is:
public bool DeleteFile(Int32 identity)
{
    string connString = "Data Source=(LocalDB)\\MSSQLLocalDB;AttachDbFilename=C:\\Code\\FileDB.mdf;Integrated Security=True;Connect Timeout=30";

    SqlConnection dbConn = new SqlConnection(connString);
    dbConn.Open();

    using (SqlCommand com = new SqlCommand("DELETE FROM HiddenFile WHERE Id = @Identity)", dbConn))
    {
        com.Parameters.AddWithValue("@Identity", identity);

        com.ExecuteNonQuery();
    }

    dbConn.Close();

    return true;
}


When I run it, there is an error: "Incorrect syntax near ')'".

Can anybody see what the problem is?

modified 6-Sep-15 8:18am.

AnswerRe: C# DELETE FROM Parameter problem Pin
Kornfeld Eliyahu Peter6-Sep-15 3:21
professionalKornfeld Eliyahu Peter6-Sep-15 3:21 
Questionjava Pin
Member 119613805-Sep-15 1:23
Member 119613805-Sep-15 1:23 
SuggestionRe: java Pin
Richard MacCutchan5-Sep-15 1:41
mveRichard MacCutchan5-Sep-15 1:41 
SuggestionWhat should be the choice.. MongoDB or Sql Server? Pin
Schatak2-Sep-15 19:40
professionalSchatak2-Sep-15 19:40 
GeneralRe: What should be the choice.. MongoDB or Sql Server? Pin
CHill603-Sep-15 6:53
mveCHill603-Sep-15 6:53 
GeneralRe: What should be the choice.. MongoDB or Sql Server? Pin
Schatak3-Sep-15 21:22
professionalSchatak3-Sep-15 21:22 
GeneralRe: What should be the choice.. MongoDB or Sql Server? Pin
jschell11-Sep-15 13:28
jschell11-Sep-15 13:28 
GeneralRe: What should be the choice.. MongoDB or Sql Server? Pin
Eddy Vluggen3-Sep-15 9:23
professionalEddy Vluggen3-Sep-15 9:23 
GeneralRe: What should be the choice.. MongoDB or Sql Server? Pin
Jörgen Andersson3-Sep-15 10:14
professionalJörgen Andersson3-Sep-15 10:14 
GeneralRe: What should be the choice.. MongoDB or Sql Server? Pin
Eddy Vluggen3-Sep-15 11:08
professionalEddy Vluggen3-Sep-15 11:08 
GeneralRe: What should be the choice.. MongoDB or Sql Server? Pin
Jörgen Andersson3-Sep-15 10:16
professionalJörgen Andersson3-Sep-15 10:16 
GeneralRe: What should be the choice.. MongoDB or Sql Server? Pin
Schatak3-Sep-15 21:30
professionalSchatak3-Sep-15 21:30 
GeneralRe: What should be the choice.. MongoDB or Sql Server? Pin
jschell11-Sep-15 13:17
jschell11-Sep-15 13:17 
GeneralRe: What should be the choice.. MongoDB or Sql Server? Pin
Herman<T>.Instance23-Sep-15 1:21
Herman<T>.Instance23-Sep-15 1:21 
QuestionPowershell backup and restore SQLscripts Pin
Stephen Holdorf2-Sep-15 14:01
Stephen Holdorf2-Sep-15 14:01 
QuestionRe: Powershell backup and restore SQLscripts Pin
Eddy Vluggen3-Sep-15 9:28
professionalEddy Vluggen3-Sep-15 9:28 
QuestionAbout Triggers Pin
dili12341-Sep-15 21:18
dili12341-Sep-15 21:18 

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.