Click here to Skip to main content
15,895,370 members
Home / Discussions / C#
   

C#

 
AnswerRe: Run Commands On Other Computers [modified] Pin
MartyExodus17-Jan-07 12:16
MartyExodus17-Jan-07 12:16 
QuestionGetting Row Index for Current Row on DataGridView Pin
Jawa200617-Jan-07 11:18
Jawa200617-Jan-07 11:18 
QuestionHow to control tooltip display time on DataGridView Pin
smcneese17-Jan-07 10:09
smcneese17-Jan-07 10:09 
QuestionHow to show a child relation column into parent DatagridView ? Pin
Marcos Hernandez17-Jan-07 10:05
Marcos Hernandez17-Jan-07 10:05 
QuestionLabel Control Size Problem ..? Pin
Software_Specialist17-Jan-07 10:04
Software_Specialist17-Jan-07 10:04 
AnswerRe: Label Control Size Problem ..? Pin
Christian Graus17-Jan-07 11:52
protectorChristian Graus17-Jan-07 11:52 
QuestionOnEnabledChanged() override never called? Pin
mike montagne17-Jan-07 9:44
mike montagne17-Jan-07 9:44 
QuestionString Manipulations – Stripping a string Pin
Ryno Burger17-Jan-07 9:13
Ryno Burger17-Jan-07 9:13 
Hi fellow C#-ers

I have a question, hope there's someone out there that might give me a possible solution to this issue.

Basically I'm trying to parse a string (the query string) to my returnResults method which in turn returns a DataSet object. What I'm trying to achieve is to strip down the query string and work with a certain number of character which in turn will be parsed to my SqlDataAdapter to provide it with the table name.

So, let’s say my query string looks like this:

<br />
SELECT * FROM Product<br />


All I basically need is the table name, in this case "Product".

How is it possible to only strip the string of the character "Product" ?

<br />
<br />
public DataSet returnResults(string query)<br />
    {<br />
        SqlDataAdapter sqlDA = null;<br />
        DataSet ds = null;<br />
        StringBuilder str = new StringBuilder();<br />
        string tableName = null;<br />
<br />
        str.Insert(0, query);<br />
<br />
        tableName = str.<br />
<br />
        //sqlDA.Fill(ds, "");<br />
<br />
        return ds;<br />
    }<br />
<br />


Your feedback will be much appreciated.

Thanks!

R
AnswerRe: String Manipulations – Stripping a string Pin
Christian Graus17-Jan-07 9:25
protectorChristian Graus17-Jan-07 9:25 
GeneralRe: String Manipulations – Stripping a string Pin
Ryno Burger17-Jan-07 17:39
Ryno Burger17-Jan-07 17:39 
GeneralRe: String Manipulations – Stripping a string Pin
Christian Graus17-Jan-07 18:02
protectorChristian Graus17-Jan-07 18:02 
AnswerRe: String Manipulations &#8211; Stripping a string Pin
Luc Pattyn17-Jan-07 9:31
sitebuilderLuc Pattyn17-Jan-07 9:31 
GeneralRe: String Manipulations &#8211; Stripping a string Pin
Ryno Burger17-Jan-07 17:42
Ryno Burger17-Jan-07 17:42 
AnswerRe: String Manipulations – Stripping a string Pin
Bassam Saoud17-Jan-07 9:47
Bassam Saoud17-Jan-07 9:47 
QuestionHow to get Visual C# Working Pin
max2929717-Jan-07 8:04
max2929717-Jan-07 8:04 
AnswerRe: How to get Visual C# Working Pin
Colin Angus Mackay17-Jan-07 9:46
Colin Angus Mackay17-Jan-07 9:46 
GeneralRe: How to get Visual C# Working Pin
max2929717-Jan-07 9:59
max2929717-Jan-07 9:59 
QuestionGet HTML textbox value in code-behind Pin
Bobb198217-Jan-07 7:49
Bobb198217-Jan-07 7:49 
AnswerRe: Get HTML textbox value in code-behind Pin
Dustin Metzgar17-Jan-07 8:14
Dustin Metzgar17-Jan-07 8:14 
GeneralRe: Get HTML textbox value in code-behind Pin
Bobb198217-Jan-07 8:26
Bobb198217-Jan-07 8:26 
GeneralRe: Get HTML textbox value in code-behind Pin
Dustin Metzgar17-Jan-07 8:45
Dustin Metzgar17-Jan-07 8:45 
AnswerRe: Get HTML textbox value in code-behind Pin
Bassam Saoud17-Jan-07 9:02
Bassam Saoud17-Jan-07 9:02 
QuestionResize Corner Pin
max2929717-Jan-07 7:32
max2929717-Jan-07 7:32 
AnswerRe: Resize Corner Pin
Dan Neely17-Jan-07 7:56
Dan Neely17-Jan-07 7:56 
QuestionRe: Resize Corner Pin
max2929717-Jan-07 7:59
max2929717-Jan-07 7:59 

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.