What Is The Advantage Using SQL Parameter
Sep 2, 2011I have a litlle idea about for the sql parameter. I need other explanation why using sql parameter and what are the Problem not using sql parameter.
View 10 RepliesI have a litlle idea about for the sql parameter. I need other explanation why using sql parameter and what are the Problem not using sql parameter.
View 10 Repliesim considering to study properly 1 of these two languages because in vb.net the limitations ive encountered were not very significant, and C# because i hear all ppl shouting at how vb express is for newbs and how C# is the way to go..What i would like to ask is, what is exactly the main advantage of C# over VB Express because what ive read from wikipedia, the only difference is the language, while C# might have 1 thing or 2 extra to vb express and vice versa...[URL]..So, could anyone clear me up please? i would really like to know if vb express is really worse than C# or the differences are only in syntaxes.
I personally used to hate VB Express at the begining but now im fastly changing my mind so im more inclined to this language, but i dont wanna wake up in 3 years realising ive been wasting so much time in a language that isnt as good as "the competition", get it?
I have the following class:
Class MyClass
Property MyInteger as Integer
Set(ByVal value as Integer)
_MyInteger = value
[code]....
As I'm not using any validation etc in my Property, is there any advantage of using a Property in this case, or would it be neater to use:
Class MyClass
Public MyInteger as Integer
End Class
Well how can I do this? So my app is faster?
View 5 RepliesWhat is the advantage of using USING keyword in vb.net??im new with the USING and it seems that most people are using this.
View 5 RepliesIn this post Jon Skeet pointed out that the following code should be changed to conform with the .NET naming conventions. Doing that would also decrease the amount of noise in the code.
[Code]...
I must admit, I was pretty much like a sheep and was following what others have done before me. I thought the prefix did not look right and then to have it twice did not make sense either. After looking at a couple of .NET Framework examples, it looks like this would be closer to the standard.
[Code]...
What is the advantage on creating ur own class and property??when making a system like POS. . . .it is necessary to create a class or property??It is possible that I will create a module and i will declare the import statemnt in the module and i will declare ol of the mysql commnds in the module and I will open the connection in the module so that ol of my forms can see my declaration?
View 2 RepliesWhat's the advantage of declaring a function as "Shared"? I've noticed that it doesn't require you to instantiate an object to use the method when it declared as "Shared". Is that the only upside?
View 3 RepliesThese two snippets do the same thing - is there one that's better than the other, or is it just a matter of preference?
Using context As MyDatabaseDataContext = New MyDatabaseDataContext()
Dim test = context.Employees.Count
End Using
vs.
Dim context As MyDatabaseDataContext = New MyDatabaseDataContext()
Dim test = context.Employees.Count
I have a VB.NET web app that is about 2000 lines of code, contains about 20 different subroutines, and about 50 different functions.Is there an easy way to "rewrite" this to take advantage of classes and objects?
View 5 RepliesI was wondering if there is any advantage to do everything programmatically instead of using design view to create forms, controls etc. Would there be any difference in size and/or performance after you compile it? So far I've been doing pretty much everything programmatically, specifying all the properties that aren't default for my forms controls but I am starting to wonder is there are any advantages to this, apart from making it easier (sometime) to manage and change the behavior of my controls.
View 10 RepliesBelow is the class with a property.
public class abc
{
public int MyProperty { get; private set; }
}
What's the benefit of typing private access modifier in setter ?
is there any real advantage to run a GC.collect after that our application has used a large quantity of memory or it is just a psychological factor?
View 17 RepliesFollowing code doesnt work and raise error "A parameter is missing. [ Parameter ordinal = 1 ]".What s wrong with it?I am developing pocket pc application in vs 2008 and sqlce 3.5 sp1.
[code]....
I'm Trying to Call the Stored Procedure which has one input Parameter and one output parameter . VB.net code is below
[Code].....
I want to have a "template" function that can receive different parameter and a type parameter, like:[code]But Vb told me that tupeList is not defined... is there a way I can do that?
View 2 RepliesIs it possible to make a procedure have a single parameter but the values for that parameter are more than one? I have this procedure:
Public Sub autoComplete(ByVal cboCombo As ComboBox)
With cboCombo
.AutoCompleteMode = AutoCompleteMode.Append[code]....
Now I was wondering if there is a way to use it like this:
autoComplete(myCombobox1, myCombobox2, myCombobox3)
Or can I use a procedure like this with 'With...End With'?
I have a method which requires a parameter to be passed in. I would like to use the Addhandler to call the method through a dynamically created button control's click event.
When I include () in the AddressOf, VS complains: 'AddressOf' operand must be the name of a method (without parentheses).
When I exclude the brackets, VS complains: Method '...' does not have a signature compatible with delegate...
My code:
CODE:
One of the things that I think is really cool about VB.NET is how built-in functions and subs have extra help text in their ToolTips like "Expression: String expression to search for replace string." as well as the usual "Replace(...parameters...) as string" text. So are the pop up boxes with things like "CompareMethod.Binary" or "CompareMethod.Text." And finally I like how some functions and subs have different sets of parameters for the same routine. For example, New FileStream() starts with either a path (string) parameter or handle parameter, but none of the 15 sets of parameters contain both path and handle parameters. Is there a way that I can set up the classes and functions I write to use these things or do they only work with built in classes and functions? If there is a way, what are the proper names for them so I can look them up in the VS/VB documentation? I would be happy enough if someone would give me an example of them, but it would be nicer if I could go through the documentation and find out if there are other cool things that are related or near by.
View 3 RepliesI have been researching for a couple of days now and to no avail. Does Anyone know how to make a custom collection that take advantage of the collection editor? I would like to be able to have 3 Color Values, 1 Boolean and 1 String.
View 15 RepliesI found this online: The following source code concatenate two strings.
[Code]...
'The Copy method copies contents of a string to another. The Copy method takes a string as input and returns another string with the same contents as the input string. For example, the following code copies str1 to strRes.
[Code]...
have an idea on what i am doing wrong here:
Compiler Error Message: BC30455: Argument not specified for parameter 'dteRDate' of 'Public Sub New(strOName As String, strOAdd As String, intOPhone As Integer, strVer As String, dteRDate As Date, dteWDate As Date, strONote As String, strOrName As
[code].....
I have a vbscript that runs under asp page. I need convert the code to VB.NET
SET objCommand = Server.CreateObject("ADODB.Command")
objCommand.ActiveConnection = Application(DB)
With objCommand
[code]....
What is the VB.Net that will do exactly the vbscript does? I like paramer(0) and 1 and 2 etc since I don't need to define the parameter(0) as integer or varchar etc. I remembered I have discuss this before and it is possible to do in VB.NET?
where i put the *'s i get the error "The parameter 'address' cannot be an empty string. Parameter name: address".
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
Dim mail As New MailMessage()
Dim SmtpServer As New SmtpClient
[code].....
My query is this:
"SELECT TOP 5 * FROM [TableName] ORDER By NEWID()"
But I want to use a SQL Parameter so it could be something like this:
"SELECT TOP @ParameterName * FROM [TableName] ORDER By NEWID()"
The normal way dosen't work:
Ct.Command.CommandText = "SELECT TOP @ParameterName * FROM [TableName] ORDER By NEWID()"
Ct.Command.Parameters.AddWithValue("@ParameterName", SomeValue)
How can I add a Parameter in this situation?
Can anyone see what I am doing wrong here? the page should "YES This is a test"
Partial Public Class testForm1
Inherits System.Web.UI.Page
Private Property test() As String
Get
'if is in session, return it, otherwise look it up
[Code]...
in my app I use my sql commands with parameters. Now, I can't save the data in the database, because a parameter has an empty string value instead of a numeric value. And I want to know, which parameter it is. This command has 31 parameters.
My questions:
1. How can I loop through the parameters and print out it's values?
2. How can I print out the sql command with it's parameter values? (if it's possible).
When I execute this on MS ACCESS SQL window I have no problem I just enter the value of product_id_fk but when I run it on vb.net application I got No parameter value [Code]
View 10 RepliesI need to convert some code from c# to VB.NET from this page.
SafeFileHandle inputHandle = null;
SafeFileHandle outputHandle = null;
SafeFileHandle errorHandle = null;
[Code]...
I want use a continuewith with a sub that have a parameter.See my exemple:
Public Sub a()
Dim t1 As New System.Threading.Tasks.Task(AddressOf b, 10)
Dim t2 As System.Threading.Tasks.Task[code].....