Differences Between Sub Procedure And Function Procedures?
Apr 19, 2011I know the major difference is that Sub Cannot return a Value while a Function Can.
View 3 RepliesI know the major difference is that Sub Cannot return a Value while a Function Can.
View 3 Repliesi used to create sub procedures in vb6 under tools/ add procedure. Same is not available in vb2008. how can i create sub procedure in form.
[Code]...
Im a student doing an assignment, how do i pass the value from a sub procedure to a function procedure....i want to pass the value from decSubtotal to a function procedure named CalculateDiscount; check out my code--
[Code]...
I created a subprocedure to change the background color of the selected matching labels in this concetration game. Now I want to change it back to silver when all the labels are selected I tried all the insertion points I could think of for a EndGame function but none have worked. I'm thinking I'm barking up the wrong tree.[code]
View 1 Replieshow to clear GridView is appeared
GridView1.DataSource = null;
GridView1.DataBind();
[Code]....
I wrote new class of gridview Inherits System.Windows.Forms.DataGridView.Vb class called my clear function in its class.Sorry,gridview.Clear() is not have.
i able to get data then i click second time i got error Procedure or function "procedure name" display has too many arguments specified" why this error. [code]
View 2 RepliesI finished coding an application for converting Celsius to Fahrenheit, and vice versa. I used the Sub Procedure to convert them. What I need now is to modify it. I would have to use the Function Procedure instead of my Sub Procedure.
[Code]...
I am working on a project that requires me to hop into to separate DB's. So I have figured that I need to have multiple functions inside of my VB page. The only problem I am having,is I am not to sure how to get this all accomplished. So far I have figured out the overall structure, just need to implement that structure.
Here is my idea:
The main Function would call two other functions. We can Call them Sub Function 1 and Sub Function 2. So, the main Function takes the saved sessions information for the E-mail address and dumps in into Sub Function 1. It needs to open up a new connection to the db/stored procedure and RUN the following procedure and then return the result. Here is the stored procedure and what I think is correct.
CREATE PROCEDURE WEB_User
(@EMAIL_ADDRESS varchar(80) = [EMAIL_ADDRESS])
AS SELECT MEMBER_NUMBER
FROM WEB_LOGIN
WHERE EMAIL_ADDRESS = @EMAIL_ADDRESS
So my question is, what is the function suppose to look like? how do I send the session information to the procedure? and finally, how do I return the stored procedure results and push back into the main function so it can be carried into sub function 2?
I have to get a value in $.I have 2 radio buttons:
-Residential Customers
-Business Customers
I have 2 List boxes:
-Premium Channels
-Connections
I also have a total Text Box and a calculate button..My goal is to get a cost given the information from the user. the list boxes will have preassigned numbers in them..The residential Customers have to pay a $4.50 Processing fee, a Basic service fee of $30 and 5$ for ever Premium Chanel they buy. The Business Customers have to pay a processing fee of $16.50, a basic service fee of $80 for the first 10 connections (4$ for any connection after that) and 50$ per Premium Chanel (no limit)
how to make the function procedure..e <input id="gwProxy" type="hidden"><!-- Session data--></input> <input id="jsProxy" onclick="jsCall();" type="hidden" />
View 3 RepliesI am trying to get the value of the CategoryID so that I can insert that value into the database when an admin wants to update product features. The stored procedure that was written is for a ListView, so I was hoping I could put something hidden in there to get the ID. When I put the Hidden Field on the page and tried to get the ID, I got the error I mentioned in the title.
<ul id="categories">
<asp:ListView ID="lvAncestorCategories" runat="server" DataSourceID="dsCategoryAncestors">
<ItemTemplate>
[code]....
I am recieving this error and i cant think why. I have checked the number of parameters being passed as well as the number of required paramaters from the sp ,regenerating the data set has given me no look.
Public Sub GetRows(ByVal [Option] As String, ByVal searchString As String)
Me.DataSet11.Clear()
SqlSelectCommand1.CommandType = CommandType.StoredProcedure
[code]....
I've attempted to use a function in my code to calculate shipping and handling. When I enter my test data quantity 2, weight 3 and price 19.95. The result displayed is that my shipping and handling is 0 but should be 1.75. This is what my shipping and handling function looks like. The name of the function is shipping_handling it accepts a parameter by value and it stores the parameter in a variable called OrdersWeight_Decimal.
[Code]...
Are the terms 'Function' and 'Procedure' synonomous?
View 2 RepliesI have to turn the GetFwt function on the code into a sub procedure. Below is the original
' Project name: Harvey Industries Project
' Project purpose: The project calculates an employee's weekly net pay.
' Created/revised: <your name> on <current date>
[Code]....
I am trying to call a stored procedure and get the idn_num as output on entering an input of a name. I get a "Procedure or function 'aaa' has to many arguements specified" error when I try to run my VB.net code
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:ParameterProject esttable.mdb;Persist Security Info=False" & ";Jet OLEDB:Database Password = "
conn.ConnectionString = "Data Source=localhostsqlexpress;Initial Catalog=PPRT;Integrated Security=True;Pooling=False"
[Code] .....
I just recently had to rebuild my development environment from scratch. I've noticed that when I'm in debugging mode and I have a breakpoint set on a Procedure or Function, instead of stepping into that P or F, it just executes it without actually stepping thru the code. What do I need to change in my "Tools" and "Options" area?
View 6 Repliesim getting this error when i run my app, i have looked at my stored procedure and VB code and cannot see anything wrong with been stuck on this for the last couple of days
View 5 RepliesThis code updates the fiscal year automatically.[code]...
View 1 Repliesthis code, it gives always error on execution of command is comes.
Try
DBconnect()
cmd.CommandText = "Designation_INSERT"
[code]......
I'm trying to create a VB .NET Sub (or function) to access to FTP server (FTPS, login, password). The purpose is to delete a specified file on this server. I have create a function which work with FTP (see below) but I need the same with FTPS. [Code]
View 3 RepliesI've been trying to figure out how to call an Oracle 10g stored function and insert the return value into my VB.NET application. Stored procedures I've been already able to figure out, but I have no idea about functions.I have the parameter set to send to the function, the oracle function works perfect, but what VB coding to I need to get that return value. The return value is a CHAR.
Again the Oracle DB is in their 10g release.
My version of VB.NET Is Visual Studio 2010.
Also I've beent trying to use the Imports System.Data.OracleClient namespace but it comes up with an error saying its not available. Right now I use System.Data.OleDb. How can I import the oracleclient?
I don't know where the extra character 'N' is coming from, there should only be one parameter coming from my SP which is the ID:
cmd1 = oStringConnection.SetCommand(sqlConnectMain, _
cmd1, "TestStoredProc", _
DBConnections.myType.cmdAsProc)
[code]....
When I ran the SQL Profiler, I found this:
exec TestStoredProc @StudentID=N'12345'
I'm trying to modify this program so that a function procedure determines the student's grade. The problem is, I don't even know where to start. here's my current code:
[Code]...
i created a dll file using vb.net then it has a shared function that will execute a stored procedure of mysql but my code is something long and when accessing it, it has a big risk that it can produce an error if there is an incorrect string input, i am asking an advice how i can make it much better or can point me something much better than my code as my reference.here is my codefirst i created a function named mysqlParamDatatype wiith 1 parameter, this function will detect the mysqldatatype of the mysql sproc parameter so it can pass the value with the correct datatype. but it is to long.
Shared Function mysqlParamDataType(ByVal i As Integer) As MySqlDbType
If i = 1 Then
Return MySqlDbType.Binary
[code].....
know in 2008 if you have procedures or functions. that there's a little "-" or "+" that lets you expand and collapse that procedure or function? I was wondering if anyone knew how to create a section so I could collapse it within the procedure? The only way I know it will do it between functions or procedures and things like that but not within the procedure.
[Code]...
I have a table that I need to insert a set of records into based on user input. IE: Selection from a list of items to choose from. For this example, let's just say it's a collection of int's.
Not a lot of good examples on the internet. There's only one related question here on SO, but it lends no answers either (both answers are dead ends).
How do you setup the call into the Package from .NET? How do you setup the Package Procedure or Function to receive the collection? How do you process the collection once inside of the Procedure or Function?
i created a function procedure and i need to the action to be carried out when i click a button, but a don't know how to call the function procedure under the click event of the button control.
View 1 RepliesI'm a beginner and doing a review for my final...the question is-Write a Function procedure that takes an array of Strings, sorts it using Shell sort and returns the sorted array. I do not get shell sort at all.
View 3 RepliesThis is the error when i try to execute my code "Procedure or function 'Get Customer data' expects parameter '@Name', which was not supplied."
objCommand.CommandType = CommandType.StoredProcedure
objCommand.CommandText = "GetCustomerData"
Dim ObjParam1 As New SqlParameter("@Name", SqlDbType.VarChar, 2000)
[Code].....
In debugging, i c the value in ObjParam1.value that I'm passing.