Checking For Input Into A Field?
Apr 2, 2011What is the method call for checking to see if data was entered into a field? I am wanting a site to display an error message if no data was entered.
View 2 RepliesWhat is the method call for checking to see if data was entered into a field? I am wanting a site to display an error message if no data was entered.
View 2 RepliesI have an ASP.NET application that crashes when a null date value is returned.
The code line is:
excelWorksheet.Cells("A" & xlRowCounter).Value = IIf(IsDBNull(dRow("sysdate")), "", Format(dRow("sysdate"), "MM/dd/yyyy"))
Error message:
ERROR: System.ArgumentException: Argument 'Expression' is not a valid value.
How would I check for a null date, and replace it with "" in my app ?
I'm a little confused about checking values in a database. What I want to do is see if a tuple such as the following exists:
[Code]...
The invoice_num is not null, it's blank: " ". What I want is to find if such an entry exists, where the invoice_num is " " and update it with a number entered into a textbox. I'm a little confused about if statements and cases in SQL, so if someone could point me in the right direction, that would be great!
I have a field that I want to check to see if it has a value or not. But my code is not working. I am using:[code]
View 9 RepliesI need to check if a Commodity entered into (TextBox1.Text) already exists on my table before i insert it. I'm having issues checking if the number of rows returned from my Select is equal 0? Also i'm wondering should i be checking for an exception and open/closing my connections each time i make a call to my DB or is the way i have it coded below OK?
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Try
myConnection = New SqlConnection("server=localSQLEXPRESS;uid=sa;password=12345;database=My DB")
myConnection.Open()
[code]....
I have a textbox that acts as a password field. It is supposed to contain a value at least 8 characters long and not greater than 12 characters in length. I need to construct an if statement that checks to see if there is at least 1 numeric character in the string and at least one letter in the string.
View 4 RepliesI have text box in my program where I need the user to enter at least six characters. They also need to include at least one alphabetic and one numeric character.My idea is to create a loop that uses the IndexOf string manipulation to check each character. I'm familiar with the IsNumeric method .
View 4 RepliesCan I set this function so that if the local settings.txt exists, it will NOT be overwritten unless the mapped file is newer?
If IO.File.Exists("C: empsettings.txt") = False Then
IO.File.Copy("K: empsettings.txt", "C: empsettings.txt")
ElseIf IO.File.Exists("C: empsettings.txt") = True Then
[Code]...
Currently modifying a program that is being used by several staff. Each time they restart it, it starts the latest build.
I have a settings.txt file that is needed for the latest build(not on all pc's yet, original version has the settings written in the code) and updated as needed.
If local PC doesn't have settings.txt, it is copied, if it does have settings.txt it gets overwritten by the mapped copy on each run.
Wanting to let users keep their 'personalized' local settings.txt, unless I add a new feature to the program that requires a change to the mapped settings.txt file.
I have been trying to check if a user has input a specific time format into a textbox.For example
1- User enters time in hhmm format
2- Checks the input
3- If wrong, MessageBox.Show("Need hh:mm time format")
I have only used IF statement with IsNumeric to check for number input but was unsuccessful with various attempts I can think of for checking a time format as I need Option Strict On and have the following error: Option Strict On disallows implicit conversions from 'String' to 'Date'.Is there a way to like check if the hh:mm has the ":" separator too?
For example, I clicked the Add Text box button, so it added 3 text boxes in the form (I used Dynamic text box so it can add multiple text box). When I input data to one of those 3 text boxes and then Save button has been clicked. It should checked whether the dynamic text boxes are empty or not. If there are empty text boxes, then saving data to db should not be continued and display a message telling the user that empty field(s) are invalid.
In the code below, it saves the data even if there are empty text boxes and I think because it is in the for loop, it checks the text boxes one by one and repeatedly displays the message box that I coded.
Here's the complete code:
Imports System.Data
Imports System.Data.SqlClient
Public Class Form3
[Code]....
Ok a newbie question that I just can't find the answer to:I created a simple form with 3 textboxes and have a problem using a barcode scanner to read data in to the form. The scan gives me the correct data, but it appears in VB2008 express the CRLF get absorbed and doesn't go to the next text box. In fact hitting the enter doesn't do it either, while the tab key does.
If I scan to notepad, wordpad, etc. the CRLF causes the cursor to drop to the next line, so I know the barcode scanner is programmed correctly. What should I be looking for to have the scanned data cause focus to go tot the next textbox?
I am having trouble catching getting the currently active text input on a 3rd party window.
If I use GetForegroundWindow it returns the handle of the main process of that window.
webbrowser1.document.All.Item(f_id).InnerText = f_data
f_id (input field id) , f_data (set data)
it can work
but
f_data=webbrowser1.document.All.Item(f_id).InnerText
f_data cannot get anything?
i want to convert the user input field to MD5 Algorithm
View 2 RepliesHow can input number to database where my field in database data type money.[code]...
View 5 Replieswhat I'm trying to do is setup my browser so that when I click an input field like a username, password, etc I would have a screen pop up where I can assign the "id" or "name" of the tag to a variable. Here is a screenshot of what I am trying to do. screenshot.jpg I am able to create those pop up boxes using a custom Content Menu Strip. Here is the code I have behind the context tab
[Code]....
the following sets my stage
vb.net
MasterPages
Usercontrol with defined events
This is what my usercontrol looks like:When the user clicks the 'Approve' button, an event is fired in the usercontrol that is then intercepted in the main page to do custom code (database update, mails etc...)
[Code]...
I'm fairly new to ASP.NET & VB.I've been asked to take an existing textbox that is automatically filled with the current date and allow the user to either add a "+" or "-" and a number or a spcific number and convert that into a date.I underdstand the basic concept on how to do this, but I'm running into some problems using the proper commands in order for this to work.The Textbox is called txtDate.What I've tried to do is this:
If txtDate = '+' Or '-' Then
DateAdd("d", txtDate, today)
End If
Here is what the whole thing looks like:
Protected
Sub
DateEnter_Click(ByVal
sender As[code].....
I making an "sign in" application for checking email address with username and password as input.As output it will show me msgbox with content "Your email and password are correct!" or Not.There is a code:
Code:
Imports System.Net.Mail
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click[code].....
I making an "sign in" application for checking email address with username and password as input.As output it will show me msgbox with content "Your email and password are correct!" or Not.
[Code]...
Is there any better performance by checking for a true value like this:
[CODE]..............
Than like this:
[CODE]..............
I am building a data based application using VB 2008 an SQL Express. I need to create textboxes on my form using code, (With & End With) method. I need a simple code string that will allow the app to check if the field to wich the textbox wil be databound is Nul, If so the textbox will not be created.
View 8 RepliesThere are lots of questions about this but I've not been able to solve my problem using the answers to any of them (after many, many attempts..)
I'm working in vb.net creating an asp.net web application. I have an SqlDataSource and a GridView on my page.
I want to change the DoNotMail boolean value represented by a Gridview checkbox and automatically update in the database if the checkbox is checked from 0 (False, Will Mail) to 1 (True, Won't Mail) here is the code I used. [code]...
is it possible to do a two way sync on the entire gridview when the user hits a button so you don't have to do an update every time a row is changed? because the user might check the box and then check another box then uncheck a box and it would be a lot of updates...
Dim query as String = "Select * from openquery (devbook, 'SELECT wb.arrival_time FROM web_bookings wb ')"All I need is to convert my arrival_time into a datetime field in the query
View 1 RepliesI am trying to edit a dbf table. I would like to be able to rename field headings and change the field type, ie string or dbl, and the size of the field. is this possible to do with vb.net. I have connected to the dbf file but after that am lost on what to do.
View 3 RepliesI need some help with the input validation of my application. Attached is the code that I have written as well as a screenshot of the front end. I specifically need input validation to verify that the user selected input for cbLengthOfStay is a number between 1-10 as well as input validation to verify the user input for txtMedication, txtSurgicalCharges, txtLabFees and txtRehabilitation is a positive numerical number. Please feel free to critique my attached code. [Code]
View 2 RepliesIf my Category and Forum selection is incorrect I am sorry and feel free to move it. I'd like to have the users input in the message box that will show. For example: There is a textbox and the user puts in their name as Bob. Then the message box would be: What my main goal is, is being able to include the users input they type inside the textbox inside the message box.
View 6 RepliesI have a problem with the code, I have input the valid username and password in the form textbox to input the strings in php, but it keep displaying the messagebox that says login failed.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MessageBox.Show("Please enter your username")
ElseIf Textbox2.Text = Nothing Then
MessageBox.Show("Please enter your password")
Else
[CODE]...
I don't really know why it keep displaying the messagebox that says it failed when I have input the valid strings in the first place.
I am writing a calculator app in VB Express 2008. I'm trying to get the app to accept numeric and operator input while ignoring all the alpha input. In other words taking input from the numeric keypad and the top of the keyboard and ignoring all the letters.
Here's the block of code I have so far:
Private Sub TextBox1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
If (e.KeyCode >= Keys.D0 OrElse e.KeyCode >= Keys.NumPad0) And (e.KeyCode <= Keys.D9 OrElse e.KeyCode <= Keys.NumPad9) Then
Select Case e.KeyCode
[code]....
I can't get vb to recognize the above code it seems to skip right over it. BTW, is 'Keys.Crsel' the same as the caret '^' symbol?
On geting input into DataGridViewTextBoxColumn but the column should not accept input of data that is not integer like; 10003, 2.00, 1500.00
View 3 Replies