Populate With Info From Database?
Feb 15, 2010
I have 3 labels I want to populate with info from my database. I have a SELECT statement that works for only one piece of info but I need it to include the other 2 as well.
I have 3 labels: Current, YTD, and MTD My select statement is working for YTD but I don't know how to write the SELECT statement to include the others.
[Code]...
View 6 Replies
ADVERTISEMENT
Dec 14, 2010
this is a library management system, i dont know why it doesnt work, my code in the issue form is just the same as the return form but it doesn't work right here. it just populate the listbox with the info. from the database. my code is here,
Dim nnn As Integer
Dim mmm As Boolean
Dim xxx As Integer
[Code]....
View 5 Replies
Jan 7, 2010
I'm making a database app. I've finish the search, add new, and add function. What I'm trying to do is to expand the functionality of the add new item function.
View 2 Replies
Jan 27, 2011
I need to pull from an access database to populate a combobox. Then from there I need to have a second combo box populated depending on the selection in the first box. My thought of an example would be a website that is setup for selecting car make, modle,year...can that be done in VB?
View 1 Replies
Jun 7, 2012
i am trying to make a login screen that is connect to a database(NOT MS ACCESS).i keep geting an error when i try geting it to conect to the database
"Value of type MySqlData.mySqlClient.MySqlDataReader cannot be converted to System.data.OleDb.OleDbDataReader
At rdr = MyCommand.ExecuteReader()
dose anyone know whats going on
[Code]...
View 2 Replies
Apr 11, 2010
I created a database in access 2007, linked it to my project in visual studio 2008 (vb). When I enter some data using the UI, it does not save it in the database, and it's gone as soon as I run the program again. I dragged the textboxes from the datasource panel, onto the UI..
this is the code that was automatically generated by vs for the save button:
[code]Private Sub StaffBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StaffBindingNavigatorSaveItem.Click
[Code].....
View 2 Replies
Mar 13, 2011
This code is correct...
Do While rdr.Read
issuebook.cbmember.Items.Add(rdr.Item("FName"))
Loop
Suppose i want to add both last and first name..I tried this but getting a error
Do While rdr.Read
issuebook.cbmember.Items.Add(rdr.Item("FName" & " " & "LName"))
Loop
View 4 Replies
Mar 13, 2011
I have selected the info that i want from my database but im unaware of the syntax need to be used to add them to the datagrid.The datagrid has the column...BookName, DateRetun and DateIssued.
cn.ConnectionString = "data source = RayonRayon; initial catalog = library; uid=sa; password=minnie"
cn.Open()
cmd.Connection = cn[codee]....
View 11 Replies
Feb 4, 2011
got a new problem while trying to add a new user into the database. After i've submitted all the data i get an error message saying "Conversion failed when converting the varchar value "Aron" to data type int" to be honest, im totally stumped as to what this could meen, does it meen its trying to convert string type data to an integer? Anyway heres the code im using
[Code]....
View 3 Replies
Jan 29, 2011
im trying to add a new user login to my database through my program, and i've got the procedure worked out, i just dont know how to retrieve the inputted data.
Basically i've got three text boxes that ask for "Name" "Password" "Phone Extension" but how would i work them into his statement?
CreateLogin.CommandText = ("INSERT INTO Users (UserID, Password, Phone) Values How would i follow up after "Values"??
View 7 Replies
Jun 1, 2012
I have a gridview with four template fields that I need to be able to put info into to save to the database. When I hit the edit button and my columns change into edit mode I can enter information just fine. But when I try to loop through the control to get the information it doesn't pick anything up?
Private Sub gvOLIAdj_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles gvOLIAdjst.RowEditing
gvOLIAdjst.EditIndex = e.NewEditIndex
BindData()
End Sub
Here is the update event that I have so far... any ideas? Am I just not doing this right?
Private Sub gvOLIAdj_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles gvOLIAdjst.RowUpdating
Dim dts As DataTable = DirectCast(Session("BudgetsTable"), DataTable)
Dim row As GridViewRow = gvOLIAdjst.Rows(e.RowIndex)
[Code]...
View 2 Replies
Jan 8, 2010
how do i get info from 2 different columns in an Access database and put them together in a drop down menu. (i know how to get data so that i can see it in just a textbox but i dont know how to put 2 data together and then display in a drop down.
another question is how do i save info that has been changed back into the access database i got it from
last question- how do i make a textbox only take numbers
View 9 Replies
May 4, 2010
I am working on a project for my final in vb.net and I have a weird error when I try to insert info into my database. When I run the application it errors out on command.ExecuteNonQuery()and the error is Syntax error in INSERT INTO statement. I have the fields in my database are set as text at 255 chars. I have both inmports statments at the top, and as far as I can tell my statement is right.
Here is my code.
Dim con As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source =../../Base/LogTextCopy.accdb;Persist Security Info=False;")
Dim StrSQL As String = "INSERT INTO TIMEANDDATE(DATE, TIME) values(@date, @time)"
Dim command As New OleDbCommand()
command.CommandText = StrSQL
[Code] .....
View 4 Replies
Apr 29, 2010
So I'm having more database problems. The specific problem I am having is that I am trying to update a DataGridView to display new information that was input into the database programmatically. I have tried several methods, but none have worked, and one actually "broke" the program. So I am in need of some more assistance.
Here is the current code that I am trying to use to update the view (this contains pretty much everything that I have tried up until this point):
[Code]...
View 3 Replies
May 1, 2011
How connect Vb.Net to MYSQL..? How to add info to database user informations using mysql database. How to call login infos using mysql.
View 8 Replies
Jan 11, 2009
I am just trying to get the information i collect from the pc's hostname and pass it into a db. All the db passwords, location etc are correct but i am getting nothing.
Imports System
Imports Microsoft.Win32
Imports System.Data
Imports System.Data.SqlClient
Public Class Form1
Private Sub DB()
[Code] ......
View 14 Replies
May 9, 2012
I have been tasked by my boss to create an application that takes information from an excel database holding sales figures, margins, budgets etc calculates all the figures and exports the totalled values to a table and graph also in excel. Although this is fairly easy, there is some complications I am dealing with. In the database there are many territories, and each employee has 1 or more territories.I'm not sure what I have done wrong, however the totals are not adding up properly. My code is:
'Defines Excel Objects
Dim objExcel As New Excel.Application
Dim objWorkbook As Excel.Workbook
Dim objSheet As Excel.Worksheet
[code].....
View 3 Replies
Feb 5, 2011
I'm really new to any form of VB programming and I am trying to create a form which will allow me to take information from an attached database holding information on:
class names (i.e. Year6 Dragons)
Students names (i.e. Sarah Jessica Parker)
I want the design to look very similar to the form used in MS Access for the query wizard, which will allow me to choose a class and then specific students.
View 1 Replies
Jan 18, 2010
i am creating a booking system for my A2 project but i cant create tables or field in the database and enter information in them. I have created a ms access database in vb but after that im stuck. The database must be created in vb programatically as i get more marks for complex code.
here's my code
Imports ADOX
Module Module1
Sub Main()
[Code].....
View 3 Replies
Nov 17, 2009
What I am trying to do is get specific info from a database and what I am getting is the first entry.
I have made a database connection, made the top bar not visible and I have inserted a text box and multiple labels. My MDB database has 3 columns (street, city, postcode) and multiple rows.
What I want is when a user enters a postcode in the text field the other labels get the info related to it. I.E. when a user enters "FY1 3DL" the labels update to "King street" and "Blackpool". With the code below I get the first row from the database.
Code:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.StreetsTableAdapter.Fill(Me.WcipcodeDataSet.Streets)
End Sub
View 1 Replies
Mar 15, 2009
When I insert a new record into my DB the same information gets two records not one. I am using A datatable and sqlcommand and sqlconnection and sqldataadapter and I'm using me.bindingcontext(datatable).position to move between records.
View 2 Replies
Aug 5, 2010
how to insert info into a database through textboxes on an asp page.
currently what I have to insert is this:
Dim myConnection As SqlConnection
Dim myCommand As SqlCommand
Dim commandtxt As String
[Code].....
View 6 Replies
May 11, 2009
I am using the following SQL statement to retrieve information from an access 2003 database but this command keeps stripping out the proceeding 0 from the number of the month. The variable is called TBookingsDateFulldate
Dim sqlQuery As String = String.Format("SELECT [ID], [Date], [Zone], [Year], [Subject], [Teacher], [LessionID]" & _
" FROM tblBookings" & _
" WHERE (((tblBookings.[Date])={0})" & _
" AND ((tblBookings.[Zone])='{1}')" & _
" AND ((tblBookings.[Active])=0)" & _
" AND ((tblBookings.[LessionID])='{2}'));", TBookingsDateFull, TBookingZone, TBookingsTimes(B, 0))
View 1 Replies
Mar 24, 2010
Private Sub DisplayList(ByVal CusRef As Integer)
Dim ConnectionString As String
Dim SQLString As String
Dim TitleString As String
Dim conn As System.Data.OleDb.OleDbConnection
[Code]...
So that works, but how do I display multiple things, CustomerID & CustomerName on the same line?
I can't get it going, it only puts my CustomerName under the ID
View 2 Replies
Jan 21, 2009
I want to populate a combo box but not using a database
e.g. combobox displays
red
white
blue
But want I want is if a person chooses red I want to pass back the number 1 value to a backend database. I'm able to populate a combo box with the colours but not sure how i 'grab' the value to pass back
Dim colours as string[] = new string[] { "red", "white", "blue" }
m_cmbColours.Items.AddRange(colours)
What I want is this
value Colour
1 red
2 white
3 blue
Combobox just displays the colours and when chosen in the combo box I grab the value corresponding to colour chosen.
View 4 Replies
Mar 27, 2009
I've given up on my harder stuff and have simplified it to something else. There are no errors that pop up now but the list box doesn't populate! I took the code from a book and there's a data adapter, data connection, and data set on the form already (they're not named in this code though, since the book didn't say to). When the program opens, the list box has a line of text in it and the list box doesn't fill with the right items.
Private Sub EditStock_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
Dim dsitemlist As New DataSet
Dim itemlistadapter As New OleDbDataAdapter _
("SELECT ItemName FROM Stock", ConnectString)
[Code] .....
And here's what shows in the box.
system.data.dataviewmanagerlistitemtypedescriptor
View 1 Replies
Jun 8, 2011
I'm stuck, can someone teach me on how to populate my listview using database.
View 2 Replies
Jun 8, 2011
I need to create a search form where a combobox populates with names then the user clicks a name and the textboxes in the form are filled with the correct data for example txt_Firstname txt_last txt__nameage would all be filled with the right data from access.
I already have the combobox sorted meaning i can successfully see First names in the combo box so now all i need is helping with clicking a name in the combo box and the dataset being populated in the text boxes heres the code used to populate the combo box:
Private Sub Search_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
dbprovider = "PROVIDER = microsoft.jet.OLEDB.4.0;"
[Code]....
View 1 Replies
Dec 3, 2011
I populate a datatable from a database. The table is sorted by the first column.
Then I add some new rows to the table. After that I sort the table with pgds.Tables(0).DefaultView.Sort = "firstcolumnname"
The new added rows are listed after the originally ordered rows and not in the right order.
View 7 Replies
Jun 10, 2011
I've been working on this for three days now and I can't seem to get my listbox to populate. I'm connecting to an sql database. Where am I going wrong? Dim cmd As New SqlCommand("SELECT DISTINCT natureport FROM rates ORDER BY natureport", conn)
[Code]...
View 1 Replies