Quick question, of which the quickest and easiest answer may well be to rearrange related code, but let's see...So I have an If statement (a piece of code which is a part of a full working solution written in C#) rewritten using VB.NET. I am aware the VB.NET IIf(a, b, c) method evaluates both b and a regardless of the trueness of the first evaluation, but this seems to be the case in my standard construct, too:
If (example Is Nothing Or example.Item IsNot compare.Item) Then 'Proceed End If
I want to display an image if 2 conditions are met. The data item is not null. The value of the data item is greater than 0 Markup <img id="Img1" runat="server" visible='<%#IIF( DataBinder.Eval(Container.DataItem, "amount") is DBNull.Value Or DataBinder.Eval(Container.DataItem, "amount") = 0, False, True)%>' src="/Images/check.png" />
Error message: Operator '=' is not defined for type 'DBNull' and type 'Integer'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidCastException: Operator '=' is not defined for type 'DBNull' and type 'Integer'.
I created a sql query to check if the mobile number is registered or not. If its registered, it will send the new pin code to the customer and if its not, the customer will get a message that "This number is not registered or you are not authorized to this"... something like that... Sending of new code is already working. I just dont know how to make it as conditional statement like PHP. After you query on PHP, you can just set a variable and make a conditional statement..Here is my script in vb.net:
Private Sub CheSMS() Dim SQLServer As String = My.Settings.SQLServer Dim conn As SqlConnection[code]......
how to create a conditional statement if the value of rows is zero or not.I want my output to something like... IF the value is zero, an sms message will be sent to the client that he is not registered ELSE an sms message will be sent containing his new autogeneration code. Been working on this for a month but i have no luck.
Here's my code:
Private Sub CheSMS() Dim SQLServer As String = My.Settings.SQLServer Dim conn As SqlConnection Dim cmd As SqlCommand
How do I(Can I) code a conditional statement in a TableAdapter query? I have a product code which can be either 8 or 9 characters long. Product codes are stored in an Access 2003 db table. I need to group products so in Access I have a simple Function which work fine in a Jet SQL query. But I can't get it to work in VB 2005.
Public Function ProdCats(ByVal Prod as string) Dim Cat as string = Len(Prod) Select Case Cat
I want to use a conditional statement to determine whether the cursor clicked in a certain area of a form. Here's my inoperative code:
If MousePosition.X >= 219 And MousePosition.Y >= 5 And MousePosition.X <= 226 And MousePosition.Y <= 12 Then MsgBox("You clicked in the area") End End If
designing an inventory system and i want to generate crystal reports from sql queries.Actually want to generate monthly and yearly reports from the daily sales reports i have populated
I need to parse and separate input strings using VB.NET. Split method works in Example 1, but my problem is when I need to "skip" a space if the following value isn't in the list like Example2. My code works as expected for String1 using Split, but it fails my needs when it outputs EXT1000 and 3 as individual values - they should be part of the original string if not found in the list.I would prefer to keep it in Linq if possible. Generate some type of collection to be used for later manipulation. The main output will end up with a For Each "Results" WriteLine in text file.
Okay so I need some help with radio buttons. Basically what I am looking to do is make an "If...Then" statement but it needs to know which radio buttons were selected to finish the "then" part of the statement. What code would I use to do this?I don't really want a spoiler, more of an explanation of how it actually works also.
Just wondering if its possible in VB.NET RegEx's if you can do conditional substitutions when rebuilding a string, in the sense that extra characters can be inserted if missing. I offer this bank account example, were we're trying to standardize a bank account into the format XX-XXXX-XXXXXXX-XXX, note the 3 XXX's in the suffix
My problem is that I've created a program where I have 6 textboxes and I coded the program to write the text that is in the textboxes into a txt file. But, when reading, I want it to read just a part of each line. Check this example of the textfile[cod]e...
I would like to invoke a click on a link from a link that is generated by an HTML query. I am attempting to program an application that queries a website and am getting hung up where I download the .csv that is loaded by the website.[url]...
cansim9170974256855749928 from the url is not static and I don't know how to work around this. I thought that this link would be helpful and should be except there is no link ID to reference. Is there a way to enable a clicking event on a random csv link? I have mashed together some failing attempts at this off and on for some time now and am now in your hands.
I want to make an option to load a playlist file into a textbox.. To do this i guess i will need the OpenFileDialog and Streamreader..
Untill further i have done this
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click OpenFileDialog1.Filter = "Playlist files|*.pls;*.asx"
[Code]....
I want to be able to read ONLY the link from the file.. In the first file above it would be after the "File1=" text in the file.. And in the other file it should be whats written after the "<ref href="" part..
And as you see in the second file there are three links, so to start with it should only read the first line, maybe later i could make a selection window popup or something..
I have a string of 5 characters out of which the first two characters should be in some list and next three should be in some other list.How could i validate them with regular expressions? [code]My Strings are going to be: VBBEG, CSBEG, etc.My regular expression should find that the input string first two characters could be either VB, CS, HT and the rest should also be like that.
One number is represented with four hex values.First two hex parts are my "whole number" part, third and fouth hex numbers are my "decimal" part. I just wanted to store my complete number (whole and decimal) in an excel table.My problem is following when I am storing whole part and decimal part of my number separately, then it works fine am getting f.e. 3017 and 0,9445123 in my excel table, but when I am concatenate them, then I am getting following expression in my excel table f.e. 30,179,445,123 but I want 3017,9445123.
How do i detect a part of a string from a string? For example: i want to check if the part of the string "mummy" exists in a string:"Mummy loves Daddy and loves me too"
How to cut part from this string..."abb.c.d+de.ee+f.xxx+qaa.+.,,s,"... where i know position by this: Result is always between "." (left side of result) and "+" (right side).I know number of "." from left side and number of "+" from right side, to delimit resulting string.Problem is right side, cause i need to count "+" from end.
Say... from left side: begining is at 4th "." ( this is easy ), result is =
I would like to display only part of string. I am able to do that as long as my string is constant, how the string is not constant. How would display only the last part of my string. The string will actually be displayed by using a browse button and selecting a file.