Click here to Skip to main content
15,887,477 members
Home / Discussions / C#
   

C#

 
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 
GeneralRe: Unable to work with Multi-Threading Pin
OriginalGriff12-Sep-15 20:59
mveOriginalGriff12-Sep-15 20:59 
SuggestionRe: Unable to work with Multi-Threading Pin
Richard MacCutchan12-Sep-15 5:42
mveRichard MacCutchan12-Sep-15 5:42 
AnswerRe: Unable to work with Multi-Threading Pin
Pete O'Hanlon12-Sep-15 11:42
mvePete O'Hanlon12-Sep-15 11:42 
QuestionSimple and reusable system for user registration and tracking and auto-updates Pin
Bartosz Jarmuż12-Sep-15 1:02
Bartosz Jarmuż12-Sep-15 1:02 
AnswerRe: Simple and reusable system for user registration and tracking and auto-updates Pin
OriginalGriff12-Sep-15 1:43
mveOriginalGriff12-Sep-15 1:43 
GeneralRe: Simple and reusable system for user registration and tracking and auto-updates Pin
Bartosz Jarmuż12-Sep-15 4:19
Bartosz Jarmuż12-Sep-15 4:19 
AnswerRe: Simple and reusable system for user registration and tracking and auto-updates Pin
Dave Kreskowiak12-Sep-15 3:25
mveDave Kreskowiak12-Sep-15 3:25 
GeneralRe: Simple and reusable system for user registration and tracking and auto-updates Pin
Bartosz Jarmuż12-Sep-15 4:22
Bartosz Jarmuż12-Sep-15 4:22 
QuestionC# RUN zero-based index of the longest run in a string Pin
Erics Johnson11-Sep-15 4:40
Erics Johnson11-Sep-15 4:40 
AnswerRe: C# RUN zero-based index of the longest run in a string Pin
Richard Andrew x6411-Sep-15 5:09
professionalRichard Andrew x6411-Sep-15 5:09 
GeneralRe: C# RUN zero-based index of the longest run in a string Pin
Erics Johnson12-Sep-15 10:56
Erics Johnson12-Sep-15 10:56 

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.