473,406 Members | 2,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

problem with the database vb.net(2008)

Hi

I have a database(acces) with tabel questions and answers.
-->
tblquestions
questionId -> -> primary key
question -> string


tblanswers
questionId -> primary key
answerId-> primary key
answer-> string

There's a combobox with questions and a listbox with questions of the chosen answer(s).
I have already to add and show the questions, answers.
Now I wan't to delete the answer(s) (in the listbox) of the chosen questions
I have this already
Expand|Select|Wrap|Line Numbers
  1.    con = New OleDbConnection(providerStr & dbLoc)
  2.             con.Open()
  3.             Dim command As New OleDb.OleDbCommand("DELETE FROM Answers WHERE questionId= " & 0 & " AND answer='" & lstAnswers.SelectedIndex.ToString & "')", con)
  4.             command.ExecuteNonQuery()
  5.             con.Close()
pleas help
Jan 2 '09 #1
3 1043
Dököll
2,364 Expert 2GB
Hey there good buddy!

I suspect you can get bette seved in the .net area; I'll send there...

Let us know if anything else:-)

Dököll
Jan 3 '09 #2
@Dököll
hi

Sorry I thought this was the .net area

Can you give the link of the question please? Because I can't find it.
Jan 3 '09 #3
Frinavale
9,735 Expert Mod 8TB
Are you getting an error? If so could you please post the error details. If not could you please explain what is going wrong.

Have you seen these articles on how to use a database in your program and how to use a database in your program part II?

You should use parameters instead of creating your sql queries the way you are. But that's probably not your problem.

Have you tried running the query in Access to make sure that it works properly?

-Frinny
Jan 9 '09 #4

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

Similar topics

4
by: bj7lewis | last post by:
I am currently C++/Win32/MFC & C# programmer using VS.NET 2002 and jumped into VS.NET 2003 but that was a waste so I skipped VS.NET 2005 cause buying VS.NET 2003. Now after checking out VS.NET 2008...
4
by: =?Utf-8?B?dGhlamFtaWU=?= | last post by:
Can NET 2008 run side by side with NET 2005? -- Regards, Jamie
3
by: plonk | last post by:
Hi I'm trying to learn sql by getting a database up and running on VB.net 2008 and SQL server express. I have the database connected correctly, (i think) but when i try to add a record using this...
1
by: kunalvumca200519 | last post by:
I would like to know about wcx, wpx, wax in vb.net 2008 and what is XAML? Please reply me...
11
by: =?Utf-8?B?QXNhZg==?= | last post by:
Hello, I have just installed VISTA Enterprise and VS.NET 2008. When pressing F5 to debug my test ASP.NET website, IE 7 display the message "Internet Explorer cannot display the webpage". The...
2
by: 14All2C | last post by:
Experts I've heard that its supposed to be easy to use VB.Net objects directly with JavaScript using ASP.Net and Ajax in Visual Studio 2008. I can't find any info anywhere on how to do this,...
3
by: Cirene | last post by:
It seems like the VS.net 2008 editor is slow and buggy. Have you found this to be the case? A few times I am working and all of a sudden all my images are stretched funny. I find out that...
2
by: JDeats | last post by:
I apologize if this question is answered on MSDN, I searched and could not find a clear answer: I have a Windows XP PC that has VS.NET 2005 Professional installed. So far my VS.NET 2008...
1
progdoctor
by: progdoctor | last post by:
Guyz... can u tell me the advantage of asp.net 2008 cuz we want to migrate from asp.net 2005 to 2008.In 2005 we use infragistics as controls component. Do visual studio 2008 have components like...
8
by: rcook349 | last post by:
I have a friend who's small company is on VB6 and SQL2000 for their apps. They would like to know what arguments (high level) there are for upgrading to the current version/platform of VB.NET 2008...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.