Click here to Skip to main content
16,004,991 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: VB/SQL Question(Dave) Pin
Vimalsoft(Pty) Ltd21-Feb-08 1:28
professionalVimalsoft(Pty) Ltd21-Feb-08 1:28 
GeneralWord content not Properly shown in RichTextbox Pin
Rupesh Kumar Swami18-Feb-08 21:28
Rupesh Kumar Swami18-Feb-08 21:28 
GeneralRe: Word content not Properly shown in RichTextbox Pin
Christian Graus18-Feb-08 22:03
protectorChristian Graus18-Feb-08 22:03 
GeneralRe: Word content not Properly shown in RichTextbox Pin
Duncan Edwards Jones19-Feb-08 0:39
professionalDuncan Edwards Jones19-Feb-08 0:39 
GeneralRe: Word content not Properly shown in RichTextbox Pin
Rupesh Kumar Swami19-Feb-08 1:32
Rupesh Kumar Swami19-Feb-08 1:32 
GeneralRe: Word content not Properly shown in RichTextbox Pin
Dave Kreskowiak19-Feb-08 3:47
mveDave Kreskowiak19-Feb-08 3:47 
QuestionDatabinding slow [modified] Pin
Gr1mR33p3r18-Feb-08 19:44
Gr1mR33p3r18-Feb-08 19:44 
GeneralRe: Databinding slow Pin
Dave Kreskowiak19-Feb-08 3:45
mveDave Kreskowiak19-Feb-08 3:45 
Gr1mR33p3r wrote:
Dataset sizes vary from 2000 - 10000 rows, but form loads are very slow (when filling the datasets etc).



Gr1mR33p3r wrote:
Does anyone have some suggestions on how to speed it up?


Simple. Don't retrieve thousands of rows from the database if you're not going to need them frequently.

Retrieve only the columns from only the rows you need to get a form setup. If you only need 30 rows from a table, why retrieve 15,000 of them? This is probably going to require you rewriting a considerable chunk of your data code.


Gr1mR33p3r wrote:
DS = DH.RunQuery("Select * FROM Users WHERE Username = '" + SystemInformation.UserName + "'") 'Gets user access rights
If DS.Tables(0).Rows(0).Item("TrainingAccess") = "True" Then 'Disables button if user does not have access


Here's an example of retrieving too much information. You're using "SELECT *" which returns all the columns for the rows specified, but you're only looking at the value of a single column and discarding the rest. Change the SQL to retrieve only that column.
SELECT TrainingAccess FROM Users WHERE Username=...


I would also highly suggest looking into using parameterized queries instead of building them with string concantenation. You're opening youreself up to SQL Injection attacks and well as making your code harder to debug using the methods you are now. Read[^]



A guide to posting questions on CodeProject[^]



Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007




Generalload controls in a tab control at runtime Pin
AAGTHosting18-Feb-08 11:39
AAGTHosting18-Feb-08 11:39 
GeneralRe: load controls in a tab control at runtime Pin
Christian Graus18-Feb-08 15:44
protectorChristian Graus18-Feb-08 15:44 
GeneralRe: load controls in a tab control at runtime Pin
AAGTHosting18-Feb-08 17:37
AAGTHosting18-Feb-08 17:37 
GeneralRe: load controls in a tab control at runtime Pin
Christian Graus18-Feb-08 17:38
protectorChristian Graus18-Feb-08 17:38 
GeneralTrouble with ChangeStartMode in InvokeMethod Pin
Matthew Calabresi18-Feb-08 9:24
Matthew Calabresi18-Feb-08 9:24 
GeneralNested DataGridView Problem Pin
ccotton33318-Feb-08 8:17
ccotton33318-Feb-08 8:17 
Questioncall DB2 stored procedure? Pin
jchigg200018-Feb-08 4:33
jchigg200018-Feb-08 4:33 
QuestionIntegrating flash 8 to VB.NET Pin
rcryptified18-Feb-08 4:29
rcryptified18-Feb-08 4:29 
GeneralRe: Integrating flash 8 to VB.NET Pin
Dave Kreskowiak19-Feb-08 3:29
mveDave Kreskowiak19-Feb-08 3:29 
Questionhow do you create a primary key through code in vb.net Pin
imonfiredammit18-Feb-08 4:26
imonfiredammit18-Feb-08 4:26 
AnswerRe: how do you create a primary key through code in vb.net Pin
cstrader23218-Feb-08 5:26
cstrader23218-Feb-08 5:26 
GeneralRe: how do you create a primary key through code in vb.net Pin
imonfiredammit18-Feb-08 7:33
imonfiredammit18-Feb-08 7:33 
AnswerRe: how do you create a primary key through code in vb.net Pin
Dave Kreskowiak19-Feb-08 3:24
mveDave Kreskowiak19-Feb-08 3:24 
QuestionHow to extract the list of exe paths of all installed programs(WIN XP) Pin
Gjm18-Feb-08 3:27
Gjm18-Feb-08 3:27 
GeneralRe: How to extract the list of exe paths of all installed programs(WIN XP) Pin
Dave Kreskowiak19-Feb-08 3:19
mveDave Kreskowiak19-Feb-08 3:19 
Generalrandom numbers Pin
bapu288918-Feb-08 3:19
bapu288918-Feb-08 3:19 
GeneralRe: random numbers Pin
CKnig18-Feb-08 3:58
CKnig18-Feb-08 3:58 

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.