Implicit Vs Explicit Declaration Without The "Dim" Statement Preceding
Mar 9, 2010Is an implicit declaration basically an explicit declaration without the "Dim" statement preceding it?
View 12 RepliesIs an implicit declaration basically an explicit declaration without the "Dim" statement preceding it?
View 12 RepliesIf default 'sa' account has sys_admin permissions for the whole SQL instance and all its databases. On the database itself, if I don't have db_datareader permission enabled, I would assume it doesn't need it as it is implied but I was wondering in .net, is there way to check if db_datareader has explicitly been enabled and not just implied from the 'sa' being a sys_admin.
View 1 Replieswould like to define some custom Implicit conversion function within my VB class. How can i do that. I have seen samples in C# but not in VB
View 8 RepliesThere's error in the codes below: but I can't see what caused the error
View 4 RepliesI am having problems using the GetWindowRect statement I've searched many forums and used the API text viewer to obtain the declaration statement of which there are a few different versions, a couple being :
View 3 RepliesI have noticed in VB.Net that most Dim statements also include an assignment. Eg:Dim myvar As String = "Hello World"As this wasn't possible in VB6 I have always done the following:
Dim myvar As String
myvar = "Hello World"
I am editing in Visual Web Developer 2010, I have these pieces of code in my asmx file: <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
View 2 RepliesI got problem regarding declaration of dynamic runtime array declaration Here is my code
[Code]...
I need to trim everything preceding the last / in a string. for example if the string were "C:FilesNewprogram.exe" all I want is the "program.exe portion.
View 3 RepliesSometimes when backing up an sql file using phpmyadmin (database stuff), for some reason it forgets to double up a single quote, resulting in an error when loading the sql file back into the database when required. A line in such an sql file looks like this;[code]As shown in the example, phpmyadmin did double up the quote in "you're" as it should, but it forgot to double up the one after "27", resulting in an error.As you can see it's like this (*value*, *'value'*, (and so on) but beforehand I can;
A) Never know how many values are in such a string
B) Can't simply split the values by "," because the value itself can hold a comma aswel.
It would be easy if every value was like this; *'value'* because then I could split by " ', ' " but that's not the case, and I also never know what location the values not enclosed in single quotes are. I also can't simply double up all single quotes in the entire string because then it will also double up the ones that are enclosing the values, resulting in an error during upload again.So yeah, what I need to get done is single out all the values with regex ($1, $2 etc.) and then string.replace single quotes in those values but *only* if said single quote is not preceeded or followed by another single quote, else it would become a tripple quote resulting in an error again.
Im using HtmlAgilityPack/HAP so that I can use Xpath with HTML documents.selecting the preceding-sibling of div class="address" in this url[url].....The sibling that I want is h3 class="listingTitleLine" Here is a screenshot:
View 1 RepliesI'm working on a project which involves communications with a remote device via a modem. Communication is accomplished via HEX commands. However, with my code below, I am not receiving zeros where they are meant to be.For example, a test file contains the following HEX:
010203040506070809
However, I am only receiving this:
123456789
The zeros are critical.
Private Sub receive_data(ByVal sender As System.Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived
Dim buff As String
Dim i As Short
[code]....
I've been developing an export program which generate a csv file.
Column_A, Column_B, Column_C
00014, Sample, test
Now upon this data is viewed in csv the trailing zero from column_A is gone. it becomes 14.I revise the writing of data from Column_A which if the start of it is zero i insert a single quote. Upon viewing it in csv i got a '00014 which single quote is visible. how can i remove this single quote? which i expected to view it 00014 only in csv file.
I run understanding code in my bridge program to call the double dummy solver dds.dll.
<DllImport("dds.dll", CallingConvention:=CallingConvention.StdCall)> _ Public Shared Function SolveBoard(ByVal deal As dealstruct, ByVal target As Integer, ByVal solutions As Integer, ByVal mode As Integer, ByRef tricks As futureTricks) As Integer End Function <StructLayout(LayoutKind.Explicit)> _ Public Structure dealstruct <FieldOffset(0)> Public trump As Integer <FieldOffset(4)> Public first As Integer
[code].....
After filling in the variables, the double dummy solver is called by:
calldll = SolveBoard(dealStr, target, solutions, mode, futureStr)
With a 32-bits machine this code is functioning correct, but with a 64-bit machine the code generates next error code:
System.TypeLoadException:Could not load type 'Dealstruct' from assembly B-Bridge version 1.1.7, Culture=neutral, PublicKeyToken=null' because an object field at offset 20 that is incorrectly aligned or overlapped by a non-object field.
hich adjustments I have to make to the code so it will function correctly on 64-bit machine.
What are the main functions needed to create a .dll file in vb.net which needs to be Explicitly linked i.e at run time to an application Plz post me an equivalent code snippet in VB.Net
Explicit run-time linkingDLL files may be explicitly loaded at run-time, a process referred to simply as run-time dynamic linking by Microsoft, by using the LoadLibrary (or LoadLibraryEx) API function. The GetProcAddress API function is used to lookup exported symbols by name, and FreeLibrary — to unload the DLL.
[Code]...
If a field called X in a datarow called R is an int32 and Y is an int32 how can I make this statement work:
r!x += y with option strict on.
Error 8 Option Strict On prohibits operands of type Object for operator '+'.
How do I add an explicit reference to system.drawing in visual basic 2010 express console application?
View 1 RepliesIn C# you can define explicit add/remove code when an event is subscribed/unsubscribed.
Is this possible in VB.net?
How to implement explicit interface implementation in VB.NET?
View 3 RepliesI have some code I inherited which has a lot of warnings that I would like to get removed. Many are of the form Property '<propertyname>' doesn't return a value on all code paths. I know why it is saying this, I'm just trying to determine what the correct 0 impact way of fixing this is.[code]Unfortuantely if I put this in my code (having changed the local variable name to avoid collisions) it then complains that it is being used before it has been assigned a value.Try to analyze IL in LinqPad (not sure if this is a good test or not) reveals that the empty method is the same as the above that Reflector gave me but it is different from return Nothing and return "".What can I use to get rid of this warning while guaranteeing the code runs 100% the same? [code]I'm not sure what ldloc.0 does here. I'm wondering if it is trying to get something from a register which will be null and if that is therefore the same as ldnull in this situation but I havent' ever really studied IL much before...
View 2 RepliesThat is the question. Is there anything you can do with c++ unions that you can't with c# Explicit structs?
View 3 RepliesI need to know the proper way, or maybe I should say, the different ways to call another form from a parent or preceding form. I am currently using ex: formname.showdialog() to call my next form, but I am uncertain if I should be using that in every situation. [code] Whats the difference between these different methods? (ex: .showdialog() , .show() )I tried both of these to open a temporary form to retrieve a persons name from a database, so as the users progresses through my training program they can keep track of their scores.But, I also call other forms as I branch through my program, from the main page, to a secondary page, to a testing page, to a results page and then back to the secondary page
View 5 RepliesRight now I'm using the following code in my markup[cod]e...
I would like to be able to call it by index instead of explicitly by "SpeakerName". Is there a way to do this in ASP.NET 4.0?
When creating a T4 template in VB.NET, how do you specify Option Explicit, Option Strict,and Option Infer settings? There's some sort of <#@ #> tag for doing this, but I can't find it.
View 1 RepliesCannot implicitly convert type 'decimal' to 'int'. An explicit conversion exists
View 1 RepliesI need to explicitly load my data source variables and then call the insert method associated with the data source. The sample VB .net code is listed below. So is it sufficient for me to just call the Insert() method when I am ready to insert my values? Or do I need to create an insert event? You see if I look at the properties window for the data source, there is a lightning bolt icon that will generate events for the data source such as Insert,Inserting,Disposing,Init,Load etc.
Protected Sub btnSave_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Me.SqlDataSource1.InsertParameters.Add("@Title", "Mr.")
Me.SqlDataSource1.Insert()
I am calling a GetSerialNo function But it showing some error like:
Cannot implicitly convert type 'decimal' to 'int'. An explicit conversion exists (are you missing a cast?).
Here is the code:
CODE:
I've frequently coded something along the lines of the sample below(with stuff like Dispose ommited for clarity. ). My question is, are the volatiles needed as shown? Or does the ManualResetEvent.Set have an implicit memory barrier as I've read Thread.Start does? Or would an explicit MemoryBarrier call be better than the volatiles? Or is it completely wrong? Also, the fact that the "implicit memory barrier behavior" in some operations is not documented as far as I've seen is quite frutrating, is there a list of these operations somewhere?
class OneUseBackgroundOp
{
background args[code].....
I do the following:
Dim rw() as exportDataset.vendorPricingRow = ExportDataset.vendorPricing.Select("field1 = 1")
As most of you know, .Net framework 4.0/Visual Studio 2010 supports implicit line continuation in VB, which was not available in previous versions (at least not to my knowledge). I have a situation where I am working on an ASP.Net 3.5 application that is targeting a machine that does not currently have .Net 4.0 installed and from what I understand it won't be installed for some time yet on that machine. Obviously, my development machine does have .net 4.0 installed.
With the implicit line continuation feature in VS2010, I sometimes find myself forgetting to add the continuation, and VS2010 does not have an issue with that even when I am targeting a previous version. Additionally, I know that if I actually compile the code (business objects and such), issues with line continuation are not a problem, as the compiled dll works fine as a 3.5 .net file.
My concern is this. There are areas where I am doing VB.Net coding in the code behind(beside?) for the asp.net pages. These would only be compiled on the server when they are first used, but since the server doesn't have the .net 4.0 framework (or even if it did), does anyone know if this would this cause the compilation to fail if I missed a line continuation? If so, is there a way to enforce using line continuation characters in VS2010?
I realize that some best practices might not be getting followed here, but I'm not about to change all the development dynamics around here just yet. Also, I'm not in an environment where I could easily test this out on my own.