473,468 Members | 1,320 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

project problem

4 New Member
hii everybdy.Act now i have removed the data source and added this code,still the data is noty getting inserted
Expand|Select|Wrap|Line Numbers
  1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  2.         Dim myOleDbConnection As OleDb.OleDbConnection
  3.         Dim insertcommand As String
  4.         Dim connString As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Documents and Settings\Radhakrishnan\My Documents\Visual Studio 2008\Projects\BHARATH MATRIMONY\BHARATH MATRIMONY\My Project\REGISTRATIONGROOM.accdb;Persist Security Info=False"
  5.         insertcommand = "INSERT INTO GROOM(MATCH,NAME1,MARITAL STATUS,HEIGHT,AGE,COUNTRY,STATE,CITY,QUALIFICATION,CASTE,RELIGION,MOTHER TONGUE,MOBILE NO,RESIDENCE NO,PHOTO)VALUES (trim(cmbMatch.value),trim(txtName.text),trim(RadioButton.selected.value),trim(txtHeight.text),trim(txtAge.text),trim(cmbCountry.value),trim(cmbState.value),trim(cmbCity.value),trim(txtQualification.text),trim(cmbCaste.value),trim(cmbReligion.value),trim(cmbMotherTongue.value),trim(txtMobile.text),trim(txtResidence.text),picGroom.image)"
  6.         myOleDbConnection = New OleDb.OleDbConnection(connString)
  7.         Dim myOleDbCommand As New OleDb.OleDbCommand(insertcommand, myOleDbConnection)
  8.         myOleDbConnection.Open()
  9.         myOleDbCommand.ExecuteNonQuery()
  10.         myOleDbConnection.Close()
  11.     End Sub
plz some1 do reply
Jan 6 '10 #1
3 1054
tlhintoq
3,525 Recognized Expert Specialist
TIP: When you are writing your question, there is a button on the tool bar that wraps the [code] tags around your copy/pasted code. It helps a bunch. Its the button with a '#' on it. More on tags. They're cool. Check'em out.
Jan 6 '10 #2
tlhintoq
3,525 Recognized Expert Specialist
Database How two parts 1 and 2
http://bytes.com/topic/net/insights/...e-your-program
http://bytes.com/topic/net/insights/...rogram-part-ii
Jan 6 '10 #3
Frinavale
9,735 Recognized Expert Moderator Expert
Your SQL statement is not right.
Your values, if they are Strings in the database, have to be enclosed in quotes ('').
A better way to do this is to use parameters (this is demonstrated in part 1 of the "How to use a database in your program" articles)

-Frinny
Jan 6 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: cody | last post by:
We have a huge project, the solutuion spans 50 projects growing. Everytime I want to start the project I have to wait nearly over 1 minute for the compiler to complete building. This is...
5
by: David Webb | last post by:
The problem started when the Working Folder for a project was somehow set to the folder of another project. I set the correct working folder in VSS and deleted the .vbproj files that had been...
10
by: TokiDoki | last post by:
Hello there, I have been programming python for a little while, now. But as I am beginning to do more complex stuff, I am running into small organization problems. It is possible that what I...
3
by: David N | last post by:
I got a solution that contains about 30 projects, three of which cannot be open. When I open the project, I always receive the error message "Unable to get the project file from the Web Server" ...
7
by: Brad | last post by:
When debugging my current web project, in VS2003, I found I had lost the ability to drill down on watch objects in the Watch Window; I could only view the single value specific watch objects. ...
7
by: Kris Desmadryl | last post by:
Hi all, I create a new asp project, with just one button on the startup form but when I run I always get a messagebox with the error : "Error while trying to run project." That's all what I see...
7
by: George Copeland | last post by:
This is a request for assistance analyzing a problem we are experiencing in our VB6 development environment. All our code is developed in VB6, and our persistance layer is SQL Server. We are...
6
by: liu | last post by:
Hi all, in my vb.net solution, i have 3 project: 1. Main-this is the startup or the base of my window application. 2. Sales-this is the project that contains all the sales info 3. Product-this...
3
by: Jerad Rose | last post by:
This is regarding Visual Studio 2003 (framework 1.1). We have several projects/libraries. Of course, many of these reference each other. If we only had one solution, we would simply add all of...
0
by: parekh | last post by:
Hi All , I am facing a problem wherein my VB project is not recognizing a change in the argument list of a method ( the method itself being declared and defined in another VC++ project and it...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.