|
Is there a way to override the code that vb.net generates for Deletes, Updates and Inserts?
The code generated is slowing down my app for these functions, especially for only 1 record.
I'm using the BindingNavigator controls to add, update, delete, etc.
PPOBindingSource.EndEdit()
PPOTableAdapter.Update(Me.DwCustomDataSetPPO.BenefitAdj_PPO)
Is there someway to over ride what Vb generated and create mo own code for these functions?
The generated code is inefficient and convoluted.
Any help greatly appreciated.
Mike
|
|
|
|
|
Can any one tell me how to deploy a web application?... where as the web application module uses a web service for some applications...
thanks
with regards ,
K.Vijaya
|
|
|
|
|
Developing a windows application with VB.Net under VS 2005. I am wondering if anyone knows how I can prevent validation events from firing if the user clicks on the control box close button to exit a form. I do not want to set the CausesValidation property on all of the form controls to False as I do want validation events to fire if the user is tabbing from control to control. However, the control box close button presents an apparently ugly issue because, when clicked, not only does the validation event for the control being exited fire but the FormClosing event still fires even if the validation event fails and the program issues a Cancel. Has anyone else run across this problem and found an elegant solution?
Thank you...
|
|
|
|
|
Well, the most "elegant" solution I've come up with so far is that the cancel property of the FormClosingEventArgs is set to True at the start of the event when a control just failed validation. So, I can check that property and if it is set to True as soon as the event starts, just skip any other code in the event. I would feel better about this solution if I could trust Microsoft not to change the behavior of CausesValidation to something that actually makes logical sense in a future update or revision. If anyone thinks they have a better solution, please let me know.
|
|
|
|
|
Hello!
I am using TSQL to add to access based database. I have been getting syntax error in INSERT INTO statement. Here is the statement. If you can recognize the error please let me know. Myrequest is a collection and it is working fine.
Thanks!
Dim SrchKey
SrchKey = "INSERT INTO Estates "
SrchKey = SrchKey + "(status,stockno,portfolio,type,city,town,suburb,rooms,heating,age,floor,size,price,exchange,properforcredit,"
SrchKey = SrchKey + "opportunity,listdate,deposit,depositamount,showmainpage,description,picture1,picture2,picture3,picture4,"
SrchKey = SrchKey + "picture5,picture6,RecordStatus,SoldRent,HitCount) VALUES ("
SrchKey = SrchKey & myRequest("status") & ","
SrchKey = SrchKey + "'" & myRequest("stockno") & "',"
SrchKey = SrchKey + "'" & myRequest("portfoy") & "',"
SrchKey = SrchKey + myRequest("type") & ","
SrchKey = SrchKey + myRequest("city") & ","
SrchKey = SrchKey + "'" & myRequest("town") & "',"
SrchKey = SrchKey + "'" & myRequest("suburb") & "',"
SrchKey = SrchKey + "'" & myRequest("rooms") & "',"
SrchKey = SrchKey + "'" & myRequest("heating") & "',"
SrchKey = SrchKey + "'" & myRequest("age") & "',"
SrchKey = SrchKey + "'" & myRequest("floor") & "',"
SrchKey = SrchKey + "'" & myRequest("size") & "',"
SrchKey = SrchKey & clng(myRequest("price")) & ","
SrchKey = SrchKey + "'" & myRequest("exchange") & "',"
SrchKey = SrchKey & myRequest("properforcredit") & ","
SrchKey = SrchKey & myRequest("opportunity") & ","
SrchKey = SrchKey + "'" & myRequest("listdate") & "',"
SrchKey = SrchKey & myRequest("deposit") & ","
SrchKey = SrchKey & myRequest("depositamount") & ","
SrchKey = SrchKey & myRequest("showmainpage") & ","
SrchKey = SrchKey + "'" & myRequest("description") & "',"
SrchKey = SrchKey + "'" & SetFileName(0) & "',"
SrchKey = SrchKey + "'" & SetFileName(1) & "',"
SrchKey = SrchKey + "'" & SetFileName(2) & "',"
SrchKey = SrchKey + "'" & SetFileName(3) & "',"
SrchKey = SrchKey + "'" & SetFileName(4) & "',"
SrchKey = SrchKey + "'" & SetFileName(5) & "',"
SrchKey = SrchKey & -1 & ","
SrchKey = SrchKey & False & ","
SrchKey = SrchKey & 0 & ");"
|
|
|
|
|
Its near on impossible to tell you what the syntax error is from what you have provided, but here are some tips.
1) You are mixing '+' and '&' for string concatentation - pick one and stick with it.
2) You should not be building up a SQL query in this way, it is unsafe and leaves you open to SQL Injection attacks.
3) Try writing out the content of SrchKey after building this string to a messagebox (for example) - it will help you spot the error (Which is likely to be a missing quote, or a missing comma)
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
Hmmm.... A few things...
1. Be consistent with the string concatenation... use & rather than +.
2. Put single quotes around all string values. SQL won't accept them otherwose.
3. Check that any numeric values you enter are properly constructed in VB (e.g. this line SrchKey = SrchKey & -1 & "," really should be like this SrchKey = SrchKey & "-1," .
4. Debug the app and breakpoint at the point where the entrie string has been constructed. Inspect it for syntax errors.
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
|
|
|
|
|
And for the love of SQL, scrap this thing and use a parameterized query instead!! You've just found out one huge reason why!! Search the articles for "SQL Injection" and look for the article by Colin Angus Mackay. It has an explaination of how to do this.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi,
I have an application that compresses SQL data backups and writes it to a DVD-RAM drive on a daily basis.
How could programmatically format the DVD in VB6/.Net?
Thanxs!
you can't forget something you never knew...
|
|
|
|
|
There is nothing in the Win32 API that will do this. You'll have to find an application that does this already or see if there is an SDK for the DVD burner software that you have installed.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dave Kreskowiak wrote: You'll have to find an application that does this already
How did these guys do it?
Thanks, at least I know to stop trying to code it myself.
you can't forget something you never knew...
|
|
|
|
|
Getting to know the drivers inside and out, and knowing the commands the drivers and drives understand and using the Win32 function DeviceIoControl[^] to send them...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
How is it possible to set the size of the grouptree in a Crystalreportviewer object? This is only possible at runtime. The only available option is to display or hide the grouptree (using the DisplayGroupTree value).
-- modified at 9:45 Tuesday 25th April, 2006
|
|
|
|
|
Hi all,
Is there a book or web site that has all error codes listed with a good description of what each one means?
Thanks, Garner
|
|
|
|
|
Ive always found google to be perfect for this, just paste the error code or error message into the search and you will find a plethora of discussion on that error.
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
I want shutdown a computer in the LAN. Who help me !
nguyen kiem
|
|
|
|
|
CodeProject article.
Somebody didn't search before he posted
--------------------------------------------------------
My development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Without you giving us a valid reason to do this, and the very vague description, we have no idea WHY you want to do it - maybe it is for malicious purposes? We just don't know, so no - no one is likely to help you with this question.
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
|
|
|
|
|
The solution on my link requiers a software to be installed on the "target" computer.
But yes I agree with you
--------------------------------------------------------
My development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
|
guys i am a newbie in vb.net programming and want to seek help regarding my current program..i have an existing access database and want to use vb.net as to generate a report.question is how can i access a certain data(say "account") in a table named "customers" so that when i click the "search" button on the main form, all of the data in "account" will be loaded in another form...thanks.
|
|
|
|
|
start with this
<a>http://www.startvbdotnet.com/ado/msaccess.aspx</a>
|
|
|
|
|
|
How can I write a application, so that it can be startup in web?
May I have a detail step to do so?
|
|
|
|
|
If I understand your question, you want to write an ASP.NET application. This will be web-based and run through a browser.
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|