Database - Checking The Value Of A Field And Updating It
Aug 18, 2011
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!
View 3 Replies
ADVERTISEMENT
Mar 20, 2009
I'm using an access database in a program that I'm making for my school, the user is able to select an item from the menu, then it sends it to a list box, there is also a textbox to put a quantity of how much of the item you want. I have a field in my database called Amout Ordered, I want to update it with the amount of each item ordered, and I can't figure out how.
View 1 Replies
Jul 1, 2009
I have a piece of code that is suppose to update the password field when the user wants to change password but I get an error line:
An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll
error line: cmd.ExecuteNonQuery()
If BindingContext(ds, "login").Position < 0 Then
MsgBox("Database Is Empty !", MsgBoxStyle.Information, "Records Management System")
Exit Sub
End If
If ComboBox1.Text = "" Then
[Code] .....
View 1 Replies
Apr 24, 2009
I just want to add a DSN if it does not already exist. I am looking at the registry and I know the DSN exists but this code returns False consistently.If(not isnothing(My.Computer.Registry.CurrentUser.OpenSubKey("SOFTWAREODBCODBC.INISQL_Finance", True)),True, False) Once I get past this the next step is to add the DSN if needed.
View 4 Replies
Apr 2, 2011
What 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 Replies
Oct 25, 2011
I 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 ?
View 4 Replies
Sep 1, 2011
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 Replies
Dec 22, 2009
I 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]....
View 1 Replies
Feb 25, 2011
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 Replies
Feb 4, 2010
I am a new member that has just start coding. Im currently working on a small application for a desktop that will give me information from my system. I have code that works but might not be great. I have code that checks that the network is connected but need it to keep checking and updating. I Have tryed loops, goto and timers but not having any luck. Can anyone help point me in right direction. Here is my code so far.
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Label1.Text = TimeOfDay
Label8.Text = "Time :"
[CODE].........................
View 2 Replies
Feb 7, 2011
There 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...
View 3 Replies
Feb 16, 2011
I created a local Database in VB2008 with 4 tables, the problem is that I have a textbox in one table and a combobox in other table and I want that the information that I put in textbox appear after in combobox from the other table... that's possible?
Table: Filmes ... Field: NomeTextBox
Table: Tempo de Aluguer ... Field: Nome_FilmeComboBox
View 10 Replies
Feb 16, 2011
I have a system whereby I have a SQLite database with around 200+ records. I basically need to cycle through all rows, get the value from one of the columns, perform an algorithm, then re-insert the value.
I know I could do this in a long engrossed way, by getting all data, updating in arrays and such, and then re-inserting via tons of sql queries, however this seems a bit slow and I am sure there is some better way of doing it.
View 4 Replies
Mar 11, 2010
i found this code to update a property on an active directory entry:
If user.Properties.Contains("title") Then
user.Properties("title")(0) = employeeTitle.SelectedItem.Text
Else
user.Properties("title").Add(employeeTitle.SelectedItem.Text)
End If
I understand it except for the ("title)(0). why is this a double index array. what does the (0) do?
View 1 Replies
Jan 20, 2010
I am able to load a dataset with records from a sql database. I then loop through the data using a for loop, this works fine. As part of the loop I would like to update the contents of a textBox.text property. The problem is that it will only update the text field when the loop is complete. How can I update the text content for each record in the loop? I hope this makes since.
View 5 Replies
Feb 7, 2009
I know that when I add a record to a table through a binding source using a binding navigator - it completely handles the IDENTITY PK (it's bound to a textbox and you can see it immediately).
Now I'm trying to do this differently in another part of the program - here I only have a BINDING SOURCE - that's bound to a DATAGRIDVIEW.
I put a new record into the DGV like this
Private Sub vendorfilesDGV_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles vendorfilesDGV.DragDrop
If e.Data.GetDataPresent(DataFormats.FileDrop) Then
[Code]....
View 12 Replies
Oct 5, 2010
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 Replies
Jan 24, 2011
I'm having some trouble getting cross-thread communication/field-updating working properly in my VB.NET 2010 program. I'm trying to update a field on my main form whenever a thread that I've started throws an event. Here's a simplified version of my code:
My main form:
Public Class Main
' stuff
' Eventually, startProcessing gets called:
[Code]....
View 1 Replies
Jul 22, 2010
I am creating a database in VB.NET for a movie rental place. I currently have three forms;
Member Information
DVD Information
Borrow DVDs
What I would like to do is when I am viewing a member's details, if I click a button 'Borrow DVD for Member', the member's ID number transfers over to the Borrow DVDs table in the Member ID which also would hold some information from the DVD Information table, but I'm sure if i can figure out how to do this firstly, I will be able to apply the same rule and work it out myself.I have been trying to use a query statement like;
INSERT INTO [Borrow DVDs].[Member ID] [IN goodstuffvideos.mdb]
SELECT [Member Information].[Member ID]
FROM [Member Information]
but that has been coming up with error codes and completely not working.
Borrow DVDs table fields are: Borrow ID, Member ID, DVD ID Number, Hiring Fee, Borrowing Limit?
DVD Information table fields are: DVD ID Number, Title, Rating, Hiring Fee, Borrowing Limit Member?
Information table fields are: Member ID, Family Name, Given Name, Address, Town/Suburb, Postcode?
The error coming up is; Error in INSERT statement. Unable to parse query text.And under that it says The query cannot be represented graphically in the Diagram and Criteria Pane.
View 1 Replies
Feb 21, 2011
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].....
View 1 Replies
Jul 2, 2009
I had a dataSet which link to a database. I need to add one field inside the database, After adding the field, how can I update and link it to the dataSet?
View 4 Replies
Jun 21, 2010
I've been looking all around and i have not found a appropriate solution for my question.Here it is. I've a database table which has the field "username" and "password" and within the "username" field, there would be users like "admin","cashiers" etc. I would like to generate a login page using php that actually detects what are the users logged in as. additional info: I'm using Flash, php and MySQL. So i would just need the solution to how am i to detect.
View 3 Replies
Apr 25, 2009
I have a program which is almost complete, it gets data that is new or newly modified (well at least since my program last got this data). The problem I have is currently i'm adding this "new" data but i've just clicked some of this data may be in my database already just updated. For example, I have added some user data to my database but a user has just updated their user name - so this is now newly modified! I don't want to add it as new data I want to update my current row in my database. My question is how can i do a SQL query in my access database to see if this row exists or not?
View 2 Replies
Oct 11, 2011
here's the scenario. There's 2 types of employees; Worker and Manager. The worker will have to access the page 'worker.aspx' and the Manager will have to access the page 'manager.aspx'. In my login database (Access 2007) I have the first name, last name, username, password and job title of both workers and managers. Ex:
[Code]...
View 2 Replies
Mar 4, 2009
I have a form where when the user clicks the button the values of the form are stored in SQL database. I want to write code in order to check if a specific textbox-value already exist in the database table (in the field "Name"). I 've tried writing something but it doesn't work properly.
View 2 Replies
Nov 24, 2009
In my .NET application I have to manage bookings for rooms. I enter the room booking via an SQL query to a MS Access database using an INSERT INTO statement.
Before I insert the booking, I need to check if a booking already exists for that time period, and if it does stop the user from being able to book at that time.
I have written code to retrieve a database result on the day and time of the booking they want to book, and the fact that Access would return data would mean that the user is trying to book over someone else.
how I can check if I have a resuklt returned. My code:
cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=D:Databasedatabase.mdb;")
cn.Open()
[Code].....
But this doesn't work, it displays the messagebox regardless of if there is a row returned or not. How can I check if a row was returned?
View 1 Replies
Jan 17, 2012
i have a checkbox on a form, which is of type boolean in the database .when the user check the checkbox, before the data enters the database, the program should check if there exists already a "1" on the database for this field.If so the user is not allowed to check the depot.
View 5 Replies
Jul 18, 2011
I have this Add User Form and a Function Class, I need to know if the username typed in the Add User Form already exist in the database, so that I can warn to change the username but I have problems doing that.
Here's the code for the function class:
Public Function addUser(ByVal arole As String, ByVal ausername As String, ByVal apass As String, ByVal aname As String, ByVal aaddress As String, ByVal aregion As String, ByVal aprovince As String, ByVal atown As String, ByVal adate As Date, ByVal acreator As String) As Boolean
[Code].....
View 2 Replies
Jun 4, 2011
I sware I am loosing the will to live, I have tried to accomplish this by my-self for about 2 weeks now and I am still at square one.
I am writing an application for booking conference rooms and I need a login form.
I have created my database called Users in sql and inserted 2 default login accounts, admin and default.
I dont know how to compare the data in my database to the data typed into the username and password text boxes on the login form.
see what I have so far
Imports System.Data.SqlClient
Public Class LoginForm1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
[Code]....
I know that I have to create a click event handler for the login button and put my code in there to compare the data
View 14 Replies
Jun 16, 2011
I am trying to check where an item in my array list exists in the database.The list would have already been created at an earlier stage.Now that some items may have been removed from the database, I wish to check the list against that database before removing the items, from the list, which are no longer in the database.The following code removes all items from the list rather than just each one which doesnt exist.[code]....
View 2 Replies