Call - Pros And Cons Of Calling Procedures?

Dec 4, 2009

I would like to know the pros and cons of calling procedures with Call Keyword and without Call in VB.NET?

Private Sub ProOne()
// Code Are Here
End Sub[code].....

View 5 Replies


ADVERTISEMENT

.net - Pros And Cons Of VB And VBA?

Aug 28, 2009

On another programming related website, I saw this line in someone's signature. This is NOT the first time I've seen such sentiments, although this is the harshest:"People who work in VB or any variant thereof are not programmers, they are circus chimps throwing feces into an IDE..."VBA is my bread and butter and I can automate quite a bit of stuff with it. Yes, I know it lacks polish and some functionality, but why so much negativity toward it? On the flip side, what do other languages have that VB doesn't?

View 9 Replies

.net Vs Vb6 Pros And Cons?

Feb 13, 2007

i am a seasoned vb6 and vb.net developer and where i currently work, they use VB6. Now, we develop a range of office plugins for a client, and they currently use vb6, they also do some other projects with vb6. I want them to change to vb.net They have asked me for a list of Pros for switching, and also some Cons.

The pros i have are: .Net is future proofed, VB6 will not be supported by Microsoft for much longer One standard platform to run on (.Net) removing problems of windows versions and missing dlls full OOP support and a generic Api for office application development. Integrate seamlessly with Java using bridging components (they are primarily a java house)Quicker performance On event application loading (in office) to help application performance. Application controls are loaded but the code to execute is only loaded when required, reducing application load on start up.Backwards compatible to Office and Outlook 2003

View 12 Replies

Pros And Cons Of Using Abstract Classes

Nov 18, 2010

I have been reading up on Abstract classes and am thinking about utilizing them in an upcoming project.

I would like to know the pros and cons of using abstract classes from someone who has actually used them.

Additionally, I would like to know if the abstract class needs to be in it's own project or if they should be defined in an existing project and used within the application.

View 1 Replies

Pros And Cons Of Option Compare Binary/Text In .NET?

Jun 22, 2011

What are the pros and cons of standardizing on using Option Compare Text vs Option Compare Binary for VB.NET development?

- EDIT -Just some background since it seems like it would help - my development team has found it much easier to standardize on Option Strict On, Option Infer On, and Option Explicit due to their obvious advantages over the alternatives. What we haven't found as easy to standardize on is Option Compare Text/Binary as there seem to be advantages and disadvantages to both and different developers have differing opinions. Some of the arguments for each side have been as follows:

Some of the advantages/arguments for Option Compare Text:

It reduces verbosity in the code by removing the need for StringComparers and .ToLower() calls and StringComparison.OrdinalIgnoreCase all over the place Data needs are rarely concerned with casing, as evidenced by most databases being case-insensitive. Rarely would you ever really want to distinguish between THIS and This and this when doing a data comparison.

Certain specific use cases are simpler when you don't have to worry about casing. For example, handling ASP.NET control events where commands are sent to the codebehind as strings and casing-issues are difficult to track down as the compiler cannot help you. Think Select Case statements for <asp:repeater> events as an example.Many of the concerns raised about text comparison concern internationalization, which is often not that relevant to a lot of applications.VB specifically is case insensitive as a language, though Visual Studio helps you by at least enforcing consistency in your casing. SQL is case insensitive as well. Strings are the only place where you have to remember to worry about it, which highlights the awkwardness in ways you wouldn't normally notice it if you were worried about it everywhere.

Some of the advantages/arguments for Option Compare Binary:C# works this way, as do most other languages. It's somewhat unexpected to have alternate behavior and the unexpected is not good in programming.There is a slight performance penalty with Option Compare Text as evidenced by the IL generated on compile. Option Compare Binary doesn't have that penalty.Option Compare Text only makes certain parts of string handling case insensitive. But, it doesn't make it so that things like dictionary indexing are case insensitive by default. So, it's not like Option Compare Text actually makes it so that you don't have to worry about casing at all. If it only works half way, why bother?Programming is hard. It's best not to attempt to smooth over that fact. Worrying about string casing is part of the deal. Humans recognize THIS is different from This and tHiS. Of course your code should too - after all, they aren't really the exact same string.

View 3 Replies

.net - System.net.mail Isbodyhtml = True Vs Two AlternateViews Pros/cons?

Dec 30, 2010

Here is the use case: I am making an app that will email HTML Newsletters. The app will also email a plain text version of the newsletter as an alternate view. The way I see it there are two ways of going about this when using the system.net.mail namespace. What are the pro/cons of these two ways, or is there a another way that I am missing?

[Code]...

View 1 Replies

Asp.net - Calling Procedures From Different Pages

Nov 4, 2011

I have a Custom.ascx file that is used on a number of pages. Custom.ascx contains a couple of controls and a button called cmdCustomPageButton. When the user click on cmdCustomPageButton, cmdCustomPageButton executes a Protected Sub that gets some data from a database.

Page1.aspx that is using Custom.ascx has its own set of controls and procedures that it executes. It contains a button called cmdPage1Button and a procedure called RetriveData that is being called by other procedures as well within Page1.aspx. When cmdPage1Button is clicked it calls RetriveData. RetriveData is only applicable to Page1.aspx. Page2.aspx and Page3.aspx both has a procedure similar to RetriveData but is only relevant to its own page.

Try to explain using code:

Custom.ascx

Public Class Custom
Protected Sub cmdCustomPageButton_Click(Byval sender as Object, ByVal e as EventArgs) Handels

[CODE]..............

The question. How do I call the different RetriveData procedure form the relevant pages being it Page1, Page2 or Page3 when cmdCustomPageButton is clicked ?

View 2 Replies

Calling Stored Procedures Using ADO.NET?

Jul 10, 2009

calling stored procedures using ADO.NET. We have an application developed, which uses SQL Sever as backend and Visual foxpro as front end. In this application every thing is done by database only. That is all insert, update, delete operations are done by SQL Server only. So we have to provide some input and output paramaters to stored procedures. Some time these procedure carry out insert, update, delete operations as well as return some data in the form of tables.

View 4 Replies

BackgroundWorker - Calling Procedures From DoWork

Aug 30, 2009

As I teach myself VB, I'm working on using the backgroundworker. Mostly I'd like to use it to update a progress bar. But here the problem I'm running into...

When I use it like this:
Private Sub TestWorker_DoWork(ByVal sender As Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles TestWorker.DoWork
Dim ListText As String
For Value As Integer = 0 To 100
If TestWorker.CancellationPending Then
[Code] .....

Where GetPlayerNames() is the Sub that really contains a majority of my code, which uses a class library I wrote, and calls other functions, etc. But this just causes the backgroundworker to skip right to the RunWorkerCompleted and executes no code. It seems to me you should be able to call procedures from the DoWork and then pass updates back via the ProgressChanged event. I can't image you need to consolidate all your code into the DoWork.

View 13 Replies

VS 2008 - Any Way To Call Stored Procedures From Windows App?

Dec 10, 2009

I know that it's possible to Call a stored procedure from a Windows Application made in VS 2008. But, is it also possible to Create one? If so, isn't it possible for someone to create a SP that will delete all the data in a DB,when executed? Is there a real danger that someone could use an application that communicates with a DB to create such a procedure?

View 7 Replies

Sanitizing Is Needed For Web Services That Call Stored Procedures?

Jul 12, 2009

I am building a series of web services in VB.Each of the web services takes multiple string values, performs some validation/processing then calls a Stored Procedure using Linq to SQL. Some of the string contains user data that is stored in the database:These string values passed from the web service are escaped to trap single quote characters, semi colons and the various bracket types. I am calling the SP using the datacontext.spname(parameter1, parameter2) method.

View 3 Replies

Call Stored Procedures In Code Having Service-based Database Attached With A Form By Datasets?

Dec 23, 2011

I already know how to call insert, update, delete & select procedures in DataSet.xsd window. And I also know how to call queries by table adapters. But I just found out that its not possible to call all functions by queries (such as insert). It works when I test the query but when I try to add it, it says "Failed to get schema for this query". So I built a few stored procedures which do many functions (such as transaction, insert, update etc...). But I am unable to use these stored procedures in VB form. I found some tutorials mentioning that it can be done by defining connections and some other stuffs with which I don't want this to be. I want to call these procedures by writing code in VB code editor window with DataSets, TableAdapters, BindingSource etc...

View 2 Replies

Call Another Forms Event Procedures Event

Nov 24, 2010

I have two forms: main and sub

I need to access the even procedures like textchanged,lostfoucs,changeindex of sub form so that it can be used in main form all controls placed in sub form are included in main form and hold same name and values as of sub form how should i call it from main form to access all procedure of sub form

View 1 Replies

API Call - Vhost32 Crashes As Soon As It Comes To Calling ReadEventLog

Mar 7, 2012

I'm trying to get this to work.. What am I doing wrong?? vhost32 crashes as soon as it comes to calling ReadEventLog.

<DllImport("advapi32.dll")> _
Private Shared Function OpenEventLog(ByVal lpUNCServerName As String, ByVal lpSourceName As String) As Integer
End Function

[CODE]...

I used this C++ sample: [URL]

View 13 Replies

Calling A Vb Function With Optional Parameters With A C# Call?

Nov 3, 2010

I am interacting with VB code on a different tier, using a client-side c# program. The VB function signature looks like this:

Public Sub toggleExclusion( _
ByVal mouse As Double, _
ByVal study As Integer, _

[Code]....

I get an error saying no overloaded method of toggleExclusion takes 2 arguments?

View 3 Replies

When Call Print / Calling Form Disappears

Dec 8, 2011

I have a report (vb.net - rdlc) and I have two buttons - preview (which brings up a preview window) and print which allows me to print the report directly to my default printer with no interface whatso ever.When I call the print the calling form disappears or at least goes behind any other open windows - ie if I have MS word open my whole programme would go behind word and I loose focus)I found the code on the net to print directly and it is basically creating a stream to do the printing. [code]

View 3 Replies

Calling A Class - Get An Error When Trying To Call The Sub/function The Normal Way?

Sep 1, 2009

I have a Windows form Application that I am creating, could also be a Windows Service that I need to run.There are basically 2 Classes that were converted from java to vb.net and 1 xml file to this. for testing purposes I would like to use the Button.click event to manually run the code.However i get an error when trying to call the sub/function the normal way.I even tried to put this classes information in the Public Class Form1 but it keeps on giving me errors.This is the Sub:

Shared Sub Main(ByVal args() As String)

so how do I call it from a Button.click event?

normally i would just do a "call main()" and it works however this time it is not because of the (byVal args() as string)

View 9 Replies

Get Success Calling Updateresource Function But After When I Call Endupdateresource?

Jul 29, 2010

I get success calling updateresource function but after when i call endupdateresource i get access is denied What can i do . I have taken ownership of file still i get access is denied

the file is windowssystem32imsgeres.dll

View 7 Replies

Calling Functions - Call The Function In Order To Populate The Second List Box Upon Selection Of The First

Mar 22, 2011

I have a midterm project where we must replicate what our teacher has made, it is a convenience store program. I am having trouble calling the functions, he wants us to use these:

PopulateItems => Populate Items listbox based on the category selected
GetItemPrice => Retrieve the price for a given item
GetItemPriceFromPurchases => Retrieve the item price from the purchases list box (optional. You may not need

[CODE]...

So far I have the first list box populated when the form loads. However outside of that I do not know where to call the function in order to populate the second list box upon selection of the first.

View 3 Replies

Application Config Suggested Ways Pro And Cons

Apr 6, 2012

I have a general question on app.config, or the best way to NOT hard code a SmtpServer.Host = XXXXXXXX setting. I wrote this very simple SMTP texting application and wanted to have the settings not hard code but a form that read or writes to app.config or .ini or registry. my question is the pros and cons? and if anyone hae suggested or a link to sample project that is doing what I'm after. I have a single .exe and am new to vb.net and either want the exe to check for app.config, ini or registry if does not exist to create and then save added config, if the exe runs again it uses the newly created settings.

View 5 Replies

Does Calling The Dispose Method On A Windows.Forms.Timer Call It's Stop Method

Nov 12, 2009

Does calling the Dispose method on a Windows.Forms.Timer call it's Stop method? Or should I stop the timer before I dispose it?

View 5 Replies

Call A Method That Started On A Background Thread On The UI Thread Calling BeginInvoke And Passing In A Delegate?

Aug 27, 2011

I am trying to call a method that started on a background thread on the UI thread calling BeginInvoke and passing in a delegate as follows:

Dispatcher.BeginInvoke(Function() UpdateApplicationDataUI())

to call this method:

Private Sub UpdateApplicationDataUI()
...
End Sub

However, I get an error in the call to BeginInvoke (the UpdateApplicationDataUI portion of the delegate is stating "Expression does not produce a value").

Me.Dispatcher.BeginInvoke(Function() New Action(AddressOf UpdateApplicationDataUI))

View 1 Replies

Threaded Function Call Slower Than Calling Function Directly?

Sep 14, 2010

I have a function where I am performing a lot number of database operations inside a Sub. The operation when called directly like:ExecProcess()

takes about 11 seconds to run.However, if I create a Delegate, and call the sub using BeginInvoke(), the very same process takes over 40 seconds to execute.Here's the threaded code:

Protected del As ProcessDelegate
Protected Delegate Sub ProcessDelegate()
del = New ProcessDelegate(AddressOf SELocal.ExecJob)
Dim cb As New AsyncCallback(AddressOf Me.ExecJobComplete)
del.BeginInvoke(cb, del)

Anyone know what may cause a function to take longer inside a new thread, rather than calling directly?

View 2 Replies

Terminate Calling Procedure From The Call Up Procedure?

Nov 29, 2011

Is there a way to terminate calling procedure from the callep up procedure? I tried 'Stop' from a called up procedure in an executable; it has gone stuck; I am not able to remove it(the form) from the screen!

View 18 Replies

What Are The Pros To Using "option Explict"

Apr 20, 2012

All it really does is make me have to dim each variable, making it compile badly if I forget to dim a variable.

View 3 Replies

IDE :: How To Use Procedures

May 10, 2009

I'm trying to learn how to use procedures?

Public Function mgboc(ByVal mboc1 As String, ByVal mboc2 As String) As String
Return mboc1, mboc2
End Function

But it doesnt work. I want it to "return" the parameters, but it won't even compile.

View 2 Replies

Why To Use CLR Procedures

Jan 12, 2010

Why we use CLR procedures. Is there any significance of CLR Procedures or any example where CLR Procedure is the only solution?

View 4 Replies

Doing Computations With Procedures?

Jan 20, 2012

How can i call a procedure to calculate the cost of the suv and compact car mileage twice with that same procedure? Thats the only part i cant figure out with this function/procedure stuff. Also am i doing the procedures right?

Quote:

'Developer: John Nelson
'Date: Janurary 18 , 2012
'App Name: Compare Fuel Cost

[code]....

View 5 Replies

How To Use Stored Procedures

Feb 28, 2011

i have made some stored procedures for the first time and now i want to use them in vb.net code

'"Insert Procedure"
Sub InsertSettingz()
'Store the settings for the reports

[code]......

View 2 Replies

Multithreading With Same Procedures?

Nov 23, 2011

I have a function in my program that adjust sales for multiple days. Sometimes it needs to adjust up to 3 months and the tasks takes a while so I decided to split up the work between multiple threads. The way I have it working is say I need to adjust 3 months. I have the first thread adjust sales for the 1st month, the second thread adjust sales for the 2nd month and finally a third thread that will adjust sales for the 3rd month. Since all three threads are performing the same tasks except for different date range they use the same procedures. Within those procedures I make a call to the database to extract the sales for the given month. At some point it seems like the threads start to use the same SQL Data Objects because I am receiving the below error."There is already an open DataReader associated with this Command which must be closed first."Below is the first procedure that is ran by each thread up to the line where it errors out.

Private Sub Process_Adjustments(ByRef objAdjustBillCodeThreadParameters As clsAdjustBillCodeThreadParameters)
Dim cmd As SqlClient.SqlCommand

[code]....

So all three threads call this subroutine and the first thread does the data fill with no issues and then sometimes even the second thread does the data fill with no issue but then the third thread crashes and produces the above error. It seems as though the threads are sharing the same SQL Objects when all objects are local to the sub and I always thought each thread had it's own memory to work with. So I thought each thread would call the sub create it's own objects in memory, but that does not seem like what it's doing. I have other multithreading processes in my application that work perfectly fine, this is the first time I am attempting to multithread in this manner where I am using the same procedure within multiple threads.

Just thought of something that I might be doing wrong. The subroutine in question is in the same class where the threads are created. Should the subroutine be in it's own class, and therefore each instantiation of that class?

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved