Params By Name Or By Order?
May 1, 2011
I might be alone in this; but I was always under the impression that in .NET when you called a function you had to pass in values in the same order as the method.[code]I've ever seen just calls the method with the params in the correct order - is the named convention an old left-over from VB? If I were to use the := syntax in all my method calls, would people laugh during my next code review?
View 2 Replies
ADVERTISEMENT
Aug 17, 2009
I have a old vb6 application I maintain,that has the settings in a separate xml file.
But now I have to move those "inside" (to remove the xml, don't ask why :) ).
What would be best place/"paradigm" for such
settings to be handled in vb6 Like database connections, general parameters. Also to be easy to change it, u know what I mean. I just searched on the web but until now could not find it. Of course it is easy to hard code the ones for the moment
View 2 Replies
Apr 20, 2010
I'm having an issue with an application suite I'm developing. The bulk of the work is done in a backend dll that relies heavily on delegate subs in the different apps.
The problem I'm having is, I have a lot of these delegates typed to require a parameter. (eg, Public Delegate Sub DelTypeA(ByRef param As Object)). The individual methods will have a DelTypeA as one of their params, and I will pass it AddressOf functionA that has that signature.
This works fine for strong typing as long as the signature is something incorrect (2 params, a byval instead of a byref). But if functionA has NO params, the delegate is still created!
This works fine if I genuinely don't need to use a param, eg if the sub is simpler and I would have ignored the param anyway. But I want the strong typing to work here.
EDIT: I should add that invoking the delegate also works fine for simpler subs; the param is just not passed because it had nowhere to go. But I want to force all the subs to match the signature and do their own ignoring of the param
View 1 Replies
Jun 2, 2010
[code]...
Is there any issues with this? If I'm kicking off half a dozen threads over and over? ie: I'm not using a system where the parameters will get mixed up/corrupted?
I've looked around, and if this is OK/safe to use, this seems the easiest way to get values/params into a thread.
View 5 Replies
Jan 11, 2009
I was going over the Screen Saver Tutorial for VB Express 2005 and i Noticed How the Screen Saver app excepts params at startup... and depending on the startup param it will display the screen saver or the options form... lets say that i want to start up a screen saver from my program, how would i send it to the screen saver to display the options form the param is "/p" or something.
View 2 Replies
Jun 23, 2010
My first post as an absolute last resort. In 8 years of programming, I have never posted to a programming forum and have always been able to wiggle my way out of any diffficult project...Until this project.Every step of this project is new for me (Windows service, ini file, IIS, FTP, cmd line params, comparing file specs programmatically, using a timer, and even VB.NET is still confusing to me after several years in VB6 ). Dreading posting b/c I have so many questions. I have finished the internet, been to the end and back. Found endless suggestions of code and links and forums and only gotten more lost in the process.
I am trying to create a VB.NET app, that most likely will need to be a service, for our external clients' PCs. These PCs are not connected to our network. This app will be invisible to the user and will need to perform several tasks including:
[Code]...
View 1 Replies
Dec 23, 2009
Finding the documentation on windows API's for use with visual basic? I used to use API guide until they stopped updating it in 2002. All I need is the api name as well as the list of parameters in order to use the API's functions.
View 2 Replies
Feb 24, 2012
I am currently facing an heavy struggle with architecturing my VB.Net app.To simplify, i'm using entries from XAML comboboxs, which all trigger OnChange the same routine which manages which Function(s) to use depending on which combobox triggered.The problem i'm facing is for example i have Function(ByVal A As String, ByVal B As Integer, ByVal C as Double, etc...), and it works if the routine calls explicitly for this function's result. But then if another combobox makes for example the variable B to change, then i have to add another "If sender= Then" check for this combobox and recall expicitly the function above (since B is one of its parameters)..In the end, my routine is loooooong like 24 checks with at least 4x duplicates of same functions..is there a simple way to make a Function autoexecute when one of its parameters change without having to be called explicitly by another routine ? (Like Excel formulas do when one of its references change)
View 12 Replies
Apr 6, 2011
I'm trying to convert the C# code from this webpage to VB.Everything seems to have converted pretty much fine using an online converter tool, but then I reach the following line:
fadeOutAnimation.Completed += (sender, args) => OnFadeOutAnimationCompleted(d, hostGrid, grid);
The fadeOutAnimation.Completed event produces an event with the signature (sender, args), and d, hostGrid and grid are variables local to the function containing this mysterious event handler assignment.
I think I can see that the instruction on this C# line is telling the code to execute the OnFadeOutAnimationCompleted function, using d, hostgrid and grid as parameters, when fadeoutAnimation.Completed occurs, but I have no idea what to even search for in order to replicate this behaviour in VB.net.
View 5 Replies
Oct 21, 2010
I'm converting some RDO code to ODBC Provider code in .NET.The problem is parameter names were not specified in the orignal code, but param values were retrieved by parameter name after the command was executed.Is there anyway to have parameter names populated by the provider once the command is executed so calling code can access params by name.Let me show you an example of the declaration of param and accessing of it.
[Code]...
You can now see how this "used to work in RDO/VB". For some reason it would accept this and know what the param names were after execution. I imagine it had to do another round trip to the db to get this info.
Is there anyway to mimic this behaviour in .NET for ODBC Provider (using Oracle)? Or am I stuck manually specifying the param names in the code (I understand this is the better option, but wondering what the alternative is to match the original code as closely as possible).
View 1 Replies
Sep 24, 2009
I would like to pull a set of records in a SQL sproc by passing in a list of system.guid and also by passing in a list of integer keys.I can put the guids ihto a string, of course, but the question is - how do I quote the test values so they are recognized as UIDs by SQLIn essence I was to DECLARE @pklist AS VARCHAR(1000)-- This would look like "'45F4AE2A-D27C-D711-83FD-0008C7FA9683','EC824D02-D37C-D711-83FD-0008C7FA9683','BA8E4D02-D37C-D711-83FD-0008C7FA9683'" coming out of the execsql from vb .net - I think :-) but it seems it needs to look likeSET @pklist = '45F4AE2A-D27C-D711-83FD-0008C7FA9683,EC824D02-D37C-D711-83FD-0008C7FA9683,BA8E4D02-D37C-D711-83FD-0008C7FA9683'SELECT * from dbo.members WHERE members.cpk IN (@pklist)This only returns the record matching the first UID in the string. Is there something I can wrap a t-sql VARCHAR string with so each guid will be seen distinctly?In trying to do this with a list of integer keys, the problem is the value is seen as part of a string and is not cast to an integerIt would seem creating a table from a parsed version of the string passed in and then doing a JOIN would accomplish what I need as well, but struggling with the T-SQL syntax for that.
View 1 Replies
Apr 24, 2010
I know how to call a simple old fashion asmx webservice webthod that returns a single value as a function return result. But what if I want to return multiple output params? My current approach is to separate the params by a dividing character and parse them on teh client. Is there a better way.
[Code]...
View 2 Replies
Sep 21, 2010
Command Line Project:Export crystal report to file in pdf/excel/word format & optionally email it.Command line args incl input parameters for the crystal report.VB6 being converted to VB.net using Visual Basic 2005 Express Edition.Creator has since left & I need to fix/edit the application.Having problems... when call Export, CR params dialog box pops up awaiting user input (& params not set properly), dont want this to popup.
Code:
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Dim objReport As New ReportDocument
[code]....
View 1 Replies
Nov 1, 2009
I have a combo box bound to a datasource. I need to change one combo box (of many) to order the items in descending order.I'm guessing I could order the collection in the dataset, but that will mean all my combo boxes will be reordered?
View 2 Replies
Apr 17, 2010
I have a databound Datagridview. The DGV is bound to a datatable of a strongly typed DataSet created using the wizard. Is there any way to re order the columns before displaying them eg: the Columns are displayed in the DGV in this other Col4, Col6, Col3, Col1,Col5, Col2
But I want to it to show as Col1, Col2, col3, Col4, Col5, Col6?
I realise that the display order followed the Column order in the database table and by extension, the datatable. I have re-arranged the columns in the Database but the Datatable still retains the old order.
View 4 Replies
Oct 8, 2011
This might not be so 'VB' as it is 'SQL using VB' I have an application with a built in MS Access DB. I have a table that has a column full of integers, I shoot the DB a SQL "order by 'column name' " string and it returns the table ordered by my column of integers.BUT it returns them like this, and I want them like this
0 6
1 5
2 4
[code]....
How do I get the OrderBY to do a descending list starting with the highest number?
View 2 Replies
Aug 18, 2011
I'm working on the exercise page 73 (VB 2010 in 24 hours). It's basically a form with 2 text boxes, 2 text labels and a command button. It's really simple and uses this loop to cycle through the items, and tell me the name of them in a Messagebox
[Code]...
View 5 Replies
Jan 14, 2010
I have to order a table following a logical order but I cannot find the appropriate ORDER BY clause.To simplify I have 2 fields field1 and field2
1 record : field1 contains �2� and field2 contains �1�
2 record : field1 contains �1� and field2 contains �2�
3 record : field1 contains �2� and field2 contains �2�
[code].....
View 16 Replies
Mar 1, 2010
if a byte value can go up to 255 and two bytes are used to determine the length of packet payload data, how would I convert the two bytes to create one integer value?
State.buffer[13] = 5 and State.buffer[14] = 67
Dim PacketLengthHigh As Integer = state.buffer(13)
Dim PacketLengthLow As Integer = state.buffer(14)
[code]....
View 3 Replies
Mar 24, 2010
using LINQ to NHibernate does anybody know how to use group by and order by in the same expression. I am having to execute the group by into a list and then order this, seem that I am missing soemthing here ?
Example:-
Private function LoadStats(...) ...
Dim StatRepos As DataAccess.StatsExtraction_vwRepository = New DataAccess.StatsExtraction_vwRepository
return (From x In StatRepos.GetAnswers(Question, Questionnaire) _
[code]....
View 1 Replies
Mar 25, 2012
I got next function: The input ArrayList results is ordered correctly.The return value returnList is completly unordered.I think to problem is the HashTable isn't ordered correctly.Is there a way I can order the Hashtable or should I sort the returnList on someway?I want to order or sort on a field.
[Code]...
View 4 Replies
Nov 4, 2010
I have been trying to get my tab order correct but I cant get a combo box to be in the correct spot it only will let me focus on it first or last. When I manually enter the tabindex of each control then view the tab orderthe combo box (whos tab index i set to 6) is 1.6.
View 2 Replies
Jun 21, 2010
I have two comboboxes the first one is for order #, the second one is for the amount of order payments, there could be 1, 2, 3... payments for this order. I would like to get all payments to show in the second combobox that relate to the order # selected in the first, process that payment by changing other values in other textbox's. Then have that payment psoted as processed back to the DB table. I have a binding satament, but it pulls all payments, and not just per order. How can I get this to select just by order #?
View 2 Replies
Apr 29, 2009
I came across the KEY_GENERATOR thing (as shown below) from one of the tutorial application in vb net. Its absolutely new to me and i wanna know why it is used and how it is used. I googled but didnt find anything about it
View 1 Replies
Jan 4, 2010
I have the code for the half of the programe that i started
View 39 Replies
Jan 3, 2010
I have 6 textboxes and i want the results of theses (1-2,1-3,1-4,1-5) to drive them
1 in 5 labels but the smallest result to label1 the second result to label2.....and the bigest result to label5
2 the numbers to abs absolute
3 the equal numbers to appear once
View 34 Replies
Sep 7, 2007
How do I set it up so that when the user tabs through some controls inside a tab page, when they tab out of the last control on that page, it moves the tabControl to the next page, and focuses the first control in that page?
I do not see any tab order for each page...
View 10 Replies
Feb 22, 2009
[code]...
where and how do I implement the if statements and zorder statments for each form. If btncustomerservice_click = true then Form2.Zorder1 Form2.Show ElseIf btncustomerservice_click = false then form2.Zorder2 End If I believe I need these statements to avoid any other possible exception or error messages. These statements worked in vb6. How do I do this in vb 2008. Do I need to? What else can I do.
View 3 Replies
Aug 20, 2009
Which is a better practice? (I'm coding in .Net if that makes a difference)
IF condition = true THEN
...true action--even if rare...
ELSE
[code].....
View 10 Replies
Sep 7, 2010
If I have two Synclocks
synclock a
synclock b
end synclock
[code].....
View 1 Replies