DB/Reporting :: Creating New Records By Draging And Dropping?
Jun 2, 2008
An order can have many OrderDetails, and a Product can be on many different orders. The OrderDetail table just has the OrderID and productID, so there is essentially a many-to-many between order and product).I have a form for the user to enter a new order. I want to have an unbound box that contains the names of all the products, and to be able to drag these names into a box under the order, to add a new OrderDetail record using the productID of the dragged order along with our orderID.
View 1 Replies
ADVERTISEMENT
Jul 16, 2011
i am making a web browser, it currently creates a favorites and history file in a given directory when loading but i want it to create it in the current users documents folder automatically so it doesnt conflict with windows vista and windows 7 user control settings, heres the code i have at the moment
[code]...
View 1 Replies
Feb 28, 2008
I have a database table that has in it, for example:
Room1
Room2
Room3
[code].....
View 3 Replies
Nov 20, 2008
i have a query as follow:
gconn.BeginTrans
strSQL = "INSERT table_name (....) " & _
"SELECT fields_name FROM table_name2..." & _
[code].....
View 4 Replies
Feb 24, 2012
I am basically trying to create some records using Structures as you can see below, however the value of Index doesnt seem to be incrementing as I am assigning it to txtCustomerId.text each time form loads, however the value of the text box remains at 1000 all the time
Code:
Public Class Form1
Dim NumberOfCustomers As Integer
Dim Index As Integer
[Code].....
View 1 Replies
Feb 2, 2009
I am a high school student and i am teaching myself VB, C# and C++... it is a slow process containing mainly trial and error, looking up things online, and when the time is right asking assistance from people who know more then I.
I am currently creating a VB program that creates a database of questions, and the same or separate database. using them questions it can initiate a quiz that will save results in a different database for each student. I am having difficulties getting the code right for reading the databases, and getting it to move to the next portion of the database for each question... a little more info:
Question # = Primary key (there will not be more then 1 of the same # problem)
Question Type = i am using different integers right now to specify if the question is a T/F, Multiple Choice, Open info Et Cetra.... Question Answer = Correct answer Alt answer (x3) = option to add other answers for multiple choice problems...
I don't know exactly how to get it to read a problem and when clicking a next button on a form to have it go to the next question in the database..
View 3 Replies
Apr 1, 2009
Is it possible to have a quick and easy way of retrieving the last 10 records from a table?
Currently what I have been doing is retrieving all the records then one-by-one cylcing through each record until I have the last 10. To me this seems to have a lot of over-head reading each record. I just wondered if there was a quicker way of doing it.
View 2 Replies
Aug 17, 2009
I have a DataGridView bound to a non-SQL Server database.I need to allow users to edit existing records but under certain circumstances I need to intercept the edit and instead of committing and updating the dataset I need to delete the edited record and re-add it as a new record.I have tried using every event I can think of to do this but haven't managed to get it right. [code] This almost works but sometimes completely messes up and re-adds rows twice and all kinds of other bad side effects.
View 9 Replies
Apr 17, 2008
If I use the CmdObj.ExecuteNonQuery() I got an error
I'm not having an open connectoin.
View 2 Replies
May 7, 2008
I'm trying to build a new customer data entry page for a db project. One of the features I would like to add is a way to check and see if there have been any new records that have been added that haven't been explicitly saved to the db. If so, when the form_closing events fires I want to evaluate whether or not new entries have been made that weren't saved, and then count the number of rows that haven't been saved.
[Code]...
View 1 Replies
Mar 14, 2008
I'm using Visual Basic 2005 and I have created a program to display, edit, and create insurance records. Right now I am using an access database and it is hosted locally. What I want to be able to do is host it on our server here at our office and have the program installed on every computer on the network.
My connection string at the moment looks like this:
Code:
Public con As New OleDb.OleDbConnection
con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source = C:Insurance ProgramInsurances.mdb"
'Opens connection
con.Open()
View 11 Replies
Apr 15, 2008
I am using Windows XP and Visual Studio 2003 .NET in VB.
I have created a parameter query using data controls on a form. The SQL works when I paste it into MS Access (and set the values to those I type in the input form) it returns 3 records. In the VB form I only ever get the first matching record. By changing the input by sorting in different orders I still only get the first matching record ( a different one). If I alter my input so the first does not match but the second and third do match I get only the second. Why Don't I get the set of three?
<Code>
Part SQL:
'WHERE
' (Houses4Sale.HousesAskingPrice <= ?)
[Code].....
View 1 Replies
Dec 14, 2008
I created a project in VB.Net 2008. i use a code to Add,Update and Delete record. It works fine. The problem is: How to get current records informations when i click in gridview or listview value.
[Code]...
View 8 Replies
Jan 14, 2009
I've got a large and complex database system that is about to get even more complex, and I'm having trouble coming up with a reasonable way to model the new requirements so as to minimize the performance hit.For simplicity's sake, I'm going to use the example of certification exams, although it's not a perfect analogy for my system. So we have the following tables:
- Person
- Certification
- Exam
- Certification_Exams (join table indicating which exams are required per cert)
- Person_Exams (join table indicating which exams a person has taken)
Given that model, we can easily show that Certification A requires Exam 1, and Certification B requires Exam 2 and Exam 3.We can also determine whether a person is certified by checking Person_Exams to see if they have passed all exams required for the certification we're querying. (Note that we are not directly storing certifications for a person; these must be derived. That's one of the areas where the cert exam analogy doesn't quite match my real-life scenario, so please accept that there's a good business reason for it.In my world, the cert requirements are going to change frequently, so a person might get suddenly "un-certified.")Now enter the new requirement: We now need to be able to indicate that Certification A could be satisfied by either Exam 1 or Exam 4.And furthermore, Certification B always requires Exam 2 but also requires either Exam 3 or the combination of Exams 5, 6, and 7.I've come up with a couple different approaches so far, but the subsequent queries to be able to tell whether someone meets the criteria for a given certification are then incredibly complex.
View 11 Replies
Jul 9, 2009
I have an input parameter for my stored Proc, Instead of choosing available values from a drop Dwn, the customer wants an empty input box that when left blank returns all records. the parameter type is numeric(6,0) in the Db. I have not found a way to leave the input blank and retrieve all records. my default value for all records is '-99' and also is declared as the default value for the param in the proc.
View 1 Replies
May 2, 2008
I am starting to design in Visual Studio 2008 and I am designing a web application that connects to a SQL database. In VB6 I could create a record set and read its contents as follows.
SQLCommand = "SELECT * FROM Tablename WHERE field = '" & data & "'"
Recordset.Open SQLCommand, Database, adOpenDynamic
If Recordset.EOF = True Then
MsgBox "Record does not exist!", , "Record does not exist"
End If
Then I would Bind the fields data to, say a text box like this
Textbox.Text=Recordset("Field1")
I am finding dificult to do this in Visual Studio 2008. Does anybody know how to create a recordset in Visual Basic 2008 as described above.I have been reading a lot, watching traing videos, and researching on the Internet and I have not found any source which will explain how to do it.
View 2 Replies
Jan 8, 2009
I am writing an application in VB.Net, the application stores a number of images within the database and therefore the SQL database size gets quite large. At the moment I use a single database, however what I want to do is create a new database for each project within my application. I need some advise on the best way to proceed with this and also the best way to be able to create a new database for each project. Below is the approach that I was planning to adopt:
1. When the application is installed it automatically has a common database that comes with the application and this database is attached to the SQL Server, lets call this application "AppA" and common database "AppADB" Within the AppADB there would be a table called projectsTbl and in this projectsTbl it has a 2 columns called "projectDesc" and "projectDB". projectDesc would hold the description of a project and then the projectDB would hold the SQL database name for that project.
2. The user would login to my application and in the admin side of the application have a create project form. In this form he would enter the project description and also a 3 character code for the project. When the user OK's the form it would take the project descrption from the form and put this in the "projectDesc' field in the AppADB and then take the 3 character code from the form add this as a prefix to "AppADB" and put this within the "projectDB" field within the AppADB e.g. if the 3 character code was "SIM" then the projectDB name would be "SIMAppADB"
3. What I obviously now need to do is create a new database called "SIMAppADB" now what I was thinking was I could create a SQL database backup of a database that has the standard database structure that is required and then I can restore this .bak file (which would be in my application installed directory) to this new name, using the following code:
Code:
RESTORE DATABASE SIMAppDB
FROM DISK = 'C:Program FilesAppA Installed DirectoryDB.Bak'
WITH REPLACE, MOVE SIMAppDB_Data' TO 'C:MSSQLDATASIMAppDB_Data.MDF',
MOVE 'SIMAppDB_Log' TO 'C:MSSQLDATASIMAppDB_Log.LDF'
4. Then when the user logins to my application again, on the login screen he will see a list of projects from the "projectsTbl" table in the "AppADB" database. The user can then select the project they wish to login to and from this the application and extract the database name from the "projectDB" table in the "AppADB" database. I then can store this database name in my application and when the application needs to connect to the database it modifies the connection string to connect to the respective database.
View 1 Replies
Aug 2, 2009
I'm trying to create a database driven application using VS 2008. I want my database to be generic, i.e it shouldn't rely on the existence of MS Access or similar application. So how do I create such a database, add tables , values..etc?
View 7 Replies
Jul 1, 2008
I'm trying to write code to create a new database and then create tables within the database.
I'm running into a strange problem right now, which is the fact that I was able to create a new database ok on either the regular SQL Server instance, or the SQLEXPRESS instance. However, when I attempted to create a table, I got an error message saying that there is already a table of the same name.
When I tried to connect to the new database via SQL Server Management Studio, I could see the database. However, there are no tables in it! So, theoretically, I'm creating a brand new blank DB, so there should not be anything in this DB, right? and I should be able to create any tables I want in it!
Here is the code that I have so far:
[code...]
I just have one simple form with a button on it. The click event on this button calls the CreateAllDBs() routine.
View 6 Replies
Aug 4, 2008
I have looked around google and downloaded several program with no luck. I have a Microsoft Access 2000 DB which my web app connects to and now published the website with a MS SQL Server DB 5.0. I need to create the tables on it but its not deeming easy. The closest thing I got the creating SQLfor creating the tables was:
[Code]...
View 2 Replies
Mar 10, 2012
I have used this form to add new records on my database(ms access) in my database I have a column name 'ID' which is my primary key 'ID' is set as auto number. Now I am having a trouble on creating my update and delete button it's always saying "cannot be delete/update"
Here's my code on add, update and delete
Public Sub SaveRecord()
Try
Dim dbConn As OleDbConnection
Dim dbInsert As New OleDbCommand
Dim str1, str2, str3, str4, str5, str6, str7, str8, str9 As String
[Code] .....
Note my add is working perfectly fine. I just can find the error on my delete and update. Also I have used this to view it to my datagrid I don't know if its the right thing but it's working fine too.
'declared dbpath globally'
Dim dbPath As String = "Provider=Microsoft.Jet.Oledb.4.0; Data Source=../VG.mdb;Persist Security Info=False"
[Code] .....
Another thing is how to code each textbox and combobox to bind it to my records so that when I click on the datagridview each column will be distributed on each respective textbox.
View 1 Replies
Dec 20, 2011
I am trying to load a crystal report from two tables but it seems that is not working.Here is the code to load the crystal report:
Code:
Private Sub InvoiceLoad(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
[code]......
View 1 Replies
Mar 2, 2010
I am using VS 2008 standard edition to develop my first windows form application and it does not come with crystal components. I nedd to design few reports but I can't find any help on the net. In my vba application I create one form which accepts all parameters and based on parameter I build SQL statement and pass it to report data source. I would like to similar in vb.net, but all I see is cryatal. Can I create reports without Crystal?
View 1 Replies
Mar 20, 2012
I have two tables as follows:
Customer | Product
------------------
A | Car
A | Bike
A | Boat
[Code].....
If I use a normal JOIN then I get a list of friends for every separate product. I just want the two lists once.
The output lists with '-' need not be table cells, they can be <ul>s.
How can I achieve this? I would like to bind to ASP.net GridView. Should I try to do it all in one query, or use multiple queries and somehow add them both to the same Grid?
Each row actually forms part of a long report. Essentially each row of the report contains Customer ID, a bunch of other fields which match one-to-one with Customer ID, then the two lists for each Customer ID I described. Perhaps I can use a separate query for each list, then manually add each list to the grid on RowDataBound or similar?
View 3 Replies
Jul 5, 2008
I'm looking for some simple code that lets me create a Microsoft Access table via code.Currently all I do in Access is write and retrieve data from specific tables but now I want to be able to create them at runtime. Here is an example of the code I use to load some data just so you can get a feel of what I'm currently doing. Hopefully there is an easy way using the same rough way that I'm currently dealing with databases.
Code:
Public Sub LoadCareer()
Public rs As New ADO
[code]....
View 2 Replies
Feb 16, 2012
I was hoping to save some coding by using views to access my forms in VBInstead of using a very long query I was hoping to use
Code:
Select * FROM my_view
[code].....
View 5 Replies
Nov 25, 2009
I am creating a small admin reporting tool that gathers certain information on some PCs. Unfortuantly the user that is running the tool doesnt have access and I cant give access to those particular machines. What I have done is created a user on these machines that can get this information.I would like to then have the reporting tool run certain parts of the code as this user so the information can be obtained, without any intervention from the user running the tool. Can I hardcode this user into the code so that it runs the code as the user?
View 4 Replies
Feb 8, 2009
use the following code to create a database in ms access
Code:
'reference: Microsoft ActiveX Data Objects 2.8 Library
'reference: Microsoft ADO Ext. 2.8 for DDL and Security
[code].....
View 1 Replies
Feb 22, 2009
I am trying to intercept connections on port 2302 that is being used by a game. I was think about using something along the lines of
#Region " Imports "
Imports System
Imports System.IO
Imports System.Windows.Forms
[code]....
View 2 Replies
Oct 15, 2009
I'm running this on Microsoft Visual Basic 2008 I want to make a program with 2 forms, one with buttons, the other that will just hold picture boxes, which are created when those buttons are clicked. Once those picture boxes are placed on the second form, I want to be able to drag and drop them to move them anywhere on that second form.
I have it "working" as of right now, but it's really glitchy. Almost as if it can't keep up with my mouse movement. But I'm not moving THAT fast so I can only assume that something is wrong.The buttons work so I won't post that code here but the following code is for the second form and what I'm using to control the picture boxes.
Public Class Form2
Private counter As Integer
Private boxCounter As Integer
Private list As New ArrayList
[code]....
View 5 Replies