Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I am trying to make an UPDATE STATEMENT generator using C# Winforms. I would like to build a statement generator which will print statements like this:

UPDATE Customers
SET ContactName='Alfred Schmidt', City='Hamburg'
WHERE CustomerName='Alfreds Futterkiste';

But my problem is, how can I let the user paste in multiple values for each SET? My end user is likely to build a list using a spreadsheet and will want to paste in the values into a multi-line text box. I could create 2 multi-line text boxes, but what if i have more SET columns i need to add?

share|improve this question
    
How about a editable DataGrid component? codeproject.com/Articles/9986/Using-the-DataGrid-Control –  Mathew Foscarini Jan 25 '14 at 14:41
1  
Is there a reason why you want to generate sql from a winforms app? i used to create the sql using excel/openoffice-calc text formulas. –  k3b Jan 26 '14 at 14:24

1 Answer 1

Place simple text fields, check if user entered anything, then check/avoid SQL injection attempts, then replace 'Alfred Schmidt' with value1, etc.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.