Click here to Skip to main content
15,906,455 members
Home / Discussions / C#
   

C#

 
GeneralRe: Serializing a Dictionary of Items where the Value member is a List of instances of an Interface Pin
BillWoodruff16-Sep-15 7:37
professionalBillWoodruff16-Sep-15 7:37 
GeneralRe: Serializing a Dictionary of Items where the Value member is a List of instances of an Interface Pin
BillWoodruff15-Sep-15 6:58
professionalBillWoodruff15-Sep-15 6:58 
QuestionGridView Export to Excel keeping the date format Pin
Member 1180079714-Sep-15 3:34
Member 1180079714-Sep-15 3:34 
AnswerRe: GridView Export to Excel keeping the date format Pin
Richard MacCutchan14-Sep-15 6:31
mveRichard MacCutchan14-Sep-15 6:31 
QuestionWhat is it like working as a .NET developer? Pin
Jason Smith14-Sep-15 0:54
Jason Smith14-Sep-15 0:54 
AnswerRe: What is it like working as a .NET developer? Pin
Richard MacCutchan14-Sep-15 1:01
mveRichard MacCutchan14-Sep-15 1:01 
GeneralRe: What is it like working as a .NET developer? Pin
Jason Smith14-Sep-15 1:36
Jason Smith14-Sep-15 1:36 
QuestionHow to change a textbox text while the code is running Pin
Member 1191673513-Sep-15 20:29
Member 1191673513-Sep-15 20:29 
AnswerRe: How to change a textbox text while the code is running Pin
OriginalGriff13-Sep-15 21:03
mveOriginalGriff13-Sep-15 21:03 
AnswerRe: How to change a textbox text while the code is running Pin
BillWoodruff13-Sep-15 22:04
professionalBillWoodruff13-Sep-15 22:04 
GeneralRe: How to change a textbox text while the code is running Pin
Member 1191673514-Sep-15 23:54
Member 1191673514-Sep-15 23:54 
QuestionChange speech recognition language Pin
Member 1085025313-Sep-15 16:03
Member 1085025313-Sep-15 16:03 
AnswerRe: Change speech recognition language Pin
Dave Kreskowiak13-Sep-15 16:09
mveDave Kreskowiak13-Sep-15 16:09 
GeneralRe: Change speech recognition language Pin
Eddy Vluggen13-Sep-15 21:39
professionalEddy Vluggen13-Sep-15 21:39 
GeneralRe: Change speech recognition language Pin
Richard MacCutchan13-Sep-15 21:54
mveRichard MacCutchan13-Sep-15 21:54 
Questionmysql bracket Pin
abdujalilc12-Sep-15 16:50
abdujalilc12-Sep-15 16:50 
AnswerRe: mysql bracket Pin
Dave Kreskowiak12-Sep-15 16:56
mveDave Kreskowiak12-Sep-15 16:56 
AnswerRe: mysql bracket Pin
Wendelius12-Sep-15 18:28
mentorWendelius12-Sep-15 18:28 
AnswerRe: mysql bracket Pin
Richard Deeming14-Sep-15 2:44
mveRichard Deeming14-Sep-15 2:44 
Your code is vulnerable to SQL Injection[^].

NEVER use string concatenation to build a SQL query. ALWAYS use a parameterized query.
C#
private void BindGrid()
{
    using (MySqlConnection con = new MySqlConnection(constr))
    using (MySqlCommand cmd = new MySqlCommand(string.Empty, con))
    {
        var sb = new System.Text.StringBuilder("SELECT Rasm FROM rasmlar where Rasm_ID IN (");
        
        foreach (var id in getRasm_ID1())
        {
            if (cmd.Parameters.Count != 0) 
            {
                sb.Append(',');
            }
            
            string name = "@p" + index;
            cmd.Parameters.AddWithValue(name, id);
            sb.Append(name);
        }
        
        sb.Append(')');
        
        cmd.CommandText = sb.ToString();
        
        MySqlDataAdapter da = new MySqlDataAdapter(cmd);
        DataTable dt = new DataTable();
        da.Fill(dt);
        
        gvImages.DataSource = dt;
        gvImages.DataBind();
    }
}




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


QuestionC# Change Directory Function Pin
Erics Johnson12-Sep-15 10:59
Erics Johnson12-Sep-15 10:59 
AnswerRe: C# Change Directory Function Pin
Dave Kreskowiak12-Sep-15 16:52
mveDave Kreskowiak12-Sep-15 16:52 
AnswerRe: C# Change Directory Function Pin
BillWoodruff13-Sep-15 22:07
professionalBillWoodruff13-Sep-15 22:07 
QuestionUnable to work with Multi-Threading Pin
Bastar Media12-Sep-15 4:02
Bastar Media12-Sep-15 4:02 
AnswerRe: Unable to work with Multi-Threading Pin
OriginalGriff12-Sep-15 4:55
mveOriginalGriff12-Sep-15 4:55 
GeneralRe: Unable to work with Multi-Threading Pin
Bastar Media12-Sep-15 20:27
Bastar Media12-Sep-15 20:27 

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.