Click here to Skip to main content
15,916,842 members
Home / Discussions / C#
   

C#

 
Questionreport Pin
SVb.net7-Jun-07 2:10
SVb.net7-Jun-07 2:10 
QuestionProblem in retreiving Methods of current class using Reflection Pin
Divya Kasavar7-Jun-07 1:34
Divya Kasavar7-Jun-07 1:34 
AnswerRe: Problem in retreiving Methods of current class using Reflection Pin
Christian Graus7-Jun-07 1:50
protectorChristian Graus7-Jun-07 1:50 
AnswerRe: Problem in retreiving Methods of current class using Reflection Pin
leppie7-Jun-07 2:27
leppie7-Jun-07 2:27 
GeneralRe: Problem in retreiving Methods of current class using Reflection Pin
Brady Kelly7-Jun-07 3:19
Brady Kelly7-Jun-07 3:19 
AnswerRe: Problem in retreiving Methods of current class using Reflection Pin
szukuro7-Jun-07 4:20
szukuro7-Jun-07 4:20 
Questionquery: Oledb database and a BindingList Pin
sharp source7-Jun-07 1:29
sharp source7-Jun-07 1:29 
AnswerRe: query: Oledb database and a BindingList [modified] Pin
AikinX7-Jun-07 3:06
AikinX7-Jun-07 3:06 
sharp source, the problem is: you do to many connections to DB.
I can propose two different solutions:
1) We can include all of this in one SQL:
'OR' version:
<br />
            string queryCondition = "";<br />
            foreach (string id in TableId)<br />
            {<br />
                queryCondition += tableRecordIDColumn + " = '" + id + "' OR ";<br />
            }<br />
            // We need to cat ' OR ' from the end of the string (4 letters)<br />
            if (queryCondition != "") queryCondition = queryCondition.Remove(queryCondition.Length - 4);<br />
<br />
            string query = "SELECT * FROM " + tableName + " WHERE (" + queryCondition + "') ORDER BY " + tableRecordIDColumn;<br />


'In' version:
<br />
            string queryCondition = "";<br />
            foreach (string id in TableId)<br />
            {<br />
                queryCondition += "'" + id + "', ";<br />
            }<br />
            // We need to cat ', ' from the end of the string (2 letters)<br />
            if (queryCondition != "") queryCondition = queryCondition.Remove(queryCondition.Length - 2);<br />
<br />
            queryCondition = tableRecordIDColumn + " in (" + queryCondition + ")";<br />
<br />
            string query = "SELECT * FROM " + tableName + " WHERE (" + queryCondition + "') ORDER BY " + tableRecordIDColumn;<br />


Remark: You can get an exception like "the query is too long" (because of 2000 OMG | :OMG: entries). You can split them to 100th packs, for example

2) Restricting the logic of data getting (I think it is better)
I think you can find an way to get more simple selecting condition


>>Would there be any way to create a dataset with two tables on wich i could excecute a select query wich an inner join on the record id's??
You can. You can load all data to data. Then you just need to filter the data by using BindingSource class. But this solution is valid when you have to filter data many times per minute.


-- modified at 9:13 Thursday 7th June, 2007
GeneralRe: query: Oledb database and a BindingList Pin
sharp source7-Jun-07 3:35
sharp source7-Jun-07 3:35 
GeneralRe: query: Oledb database and a BindingList Pin
AikinX7-Jun-07 4:20
AikinX7-Jun-07 4:20 
Questioncreate dynamic text boxes Pin
tauras817-Jun-07 0:51
tauras817-Jun-07 0:51 
AnswerRe: create dynamic text boxes Pin
Sathesh Sakthivel7-Jun-07 1:01
Sathesh Sakthivel7-Jun-07 1:01 
AnswerRe: create dynamic text boxes [modified] Pin
Chintan.Desai7-Jun-07 1:41
Chintan.Desai7-Jun-07 1:41 
GeneralRe: create dynamic text boxes Pin
AikinX7-Jun-07 2:29
AikinX7-Jun-07 2:29 
AnswerRe: create dynamic text boxes Pin
AikinX7-Jun-07 2:24
AikinX7-Jun-07 2:24 
QuestionHello Is there is away to convert GraphicsPath to Image ? Pin
Epsilone37-Jun-07 0:36
Epsilone37-Jun-07 0:36 
AnswerRe: Hello Is there is away to convert GraphicsPath to Image ? Pin
szukuro7-Jun-07 1:50
szukuro7-Jun-07 1:50 
QuestionUSB Scanner and keyboard Pin
AmitG777-Jun-07 0:29
AmitG777-Jun-07 0:29 
AnswerRe: USB Scanner and keyboard Pin
Dave Kreskowiak7-Jun-07 4:25
mveDave Kreskowiak7-Jun-07 4:25 
QuestionSystem.EventHandler Pin
Muammar©7-Jun-07 0:17
Muammar©7-Jun-07 0:17 
AnswerRe: System.EventHandler Pin
szukuro7-Jun-07 1:38
szukuro7-Jun-07 1:38 
GeneralRe: System.EventHandler Pin
Muammar©7-Jun-07 3:23
Muammar©7-Jun-07 3:23 
QuestionFileMaker Processing Pin
M. J. Jaya Chitra7-Jun-07 0:16
M. J. Jaya Chitra7-Jun-07 0:16 
AnswerRe: FileMaker Processing Pin
Muammar©7-Jun-07 0:20
Muammar©7-Jun-07 0:20 
GeneralRe: FileMaker Processing Pin
M. J. Jaya Chitra7-Jun-07 0:28
M. J. Jaya Chitra7-Jun-07 0:28 

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.