473,395 Members | 2,796 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,395 software developers and data experts.

Problems On Fill(Kind of Urgent)

With an access database in vb.net.

This works in access:
SELECT JOBTRTID, JOBTRDATE, JOBTRUSER, JOBTRACTION, JOBTRCUSTNUMBER,
JOBTRCUSTSHIPTO, JOBTRCUSTNAME, JOBTRCUSTCOMPANY, JOBTRITEM, JOBTRITEMDESC,
JOBTRITEMQTY, JOBTRJOBNUMBER, JOBTRJOBSHIPTO, JOBTRJOBNAME, JOBTRJOBTYPE
FROM JOBTRANSACTIONS where (JOBTRITEM = 'TESTING3');

This is not working in vb.net where chitem is the item variable:
sql2 = "SELECT JOBTRTID, JOBTRDATE, JOBTRUSER, JOBTRACTION, JOBTRCUSTNUMBER,
JOBTRCUSTSHIPTO, JOBTRCUSTNAME, JOBTRCUSTCOMPANY, JOBTRITEM, JOBTRITEMDESC,
JOBTRITEMQTY, JOBTRJOBNUMBER, JOBTRJOBSHIPTO, JOBTRJOBNAME, JOBTRJOBTYPE
FROM JOBTRANSACTIONS where (JOBTRITEM = " & chitem & ")"

I tried plus signs and no parenthesis without success.

The rest of the code is here. The error is on fill and it says that the
required value of a parameter has not been given.
I confirmed that chitem does have a value.

Dstran1.Clear()
Dstran1.AcceptChanges()
sql2 = "SELECT JOBTRTID, JOBTRDATE, JOBTRUSER, JOBTRACTION,
JOBTRCUSTNUMBER, JOBTRCUSTSHIPTO, JOBTRCUSTNAME, JOBTRCUSTCOMPANY,
JOBTRITEM, JOBTRITEMDESC, JOBTRITEMQTY, JOBTRJOBNUMBER, JOBTRJOBSHIPTO,
JOBTRJOBNAME, JOBTRJOBTYPE FROM JOBTRANSACTIONS where (JOBTRITEM = " &
chitem & ")"
OleDbDataAdapter2 = New OleDb.OleDbDataAdapter(sql2, sConn45)
'Try
OleDbDataAdapter2.Fill(Dstran1.JOBTRANSACTIONS)
'Catch ex As Exception
'MsgBox(ex.ToString)
'Exit Sub
'End Try
Dstran1.AcceptChanges()
dsreport = Dstran1.Copy
reportdataset = "dstran"
If Dstran1.Tables(0).Rows.Count - 1 < 0 Then
MsgBox("No results found.", MsgBoxStyle.Information)
DataGrid1.Visible = False
sConn45.Close()
Button2.Enabled = False
Exit Sub
Else
Button2.Enabled = True
dv = Dstran1.Tables(0).DefaultView
DataGrid1.DataSource = dv
AddSizedColoredColumnsTran()
DataGrid1.Visible = True
DataGrid1.Refresh()
sConn45.Close()
End If
Nov 20 '05 #1
4 1019
Hi Scorpion! :O)
This is not working in vb.net where chitem is the item variable:
you didn't tell us what happens. Are you getting an error?

FROM JOBTRANSACTIONS where (JOBTRITEM = " & chitem & ")"
here you seem to have forget the quotes, it think it should be.. I can't be
sure since I don't know what chitem contains...
FROM JOBTRANSACTIONS where (JOBTRITEM = '" & chitem & "')"


--
Best Regards
Yanick Lefebvre

Please posts answers to the group so all can benefit
Nov 20 '05 #2
Cor
Hi Scorpion,

I hate SQL but I think I saw it
FROM JOBTRANSACTIONS where (JOBTRITEM = " & chitem & ")"

FROM JOBTRANSACTIONS where (JOBTRITEM = '" & chitem & "')"

You can prably not see it, but there is a single quote after the = and
before the )

But I think that is the problem.

Cor
Nov 20 '05 #3
Jan
Hi Scorpion,

Try this (assuming JOBTRITEM is a stringtype field I suggest you add a
single quote before first double quote and another between second double
quote and the bracket) ......(JOBTRITEM = '" & chitem & "')"

Regards,
Jan

"scorpion53061" <sc************@yahoo.com> wrote in message
news:uy**************@tk2msftngp13.phx.gbl...
With an access database in vb.net.

This works in access:
SELECT JOBTRTID, JOBTRDATE, JOBTRUSER, JOBTRACTION, JOBTRCUSTNUMBER,
JOBTRCUSTSHIPTO, JOBTRCUSTNAME, JOBTRCUSTCOMPANY, JOBTRITEM, JOBTRITEMDESC, JOBTRITEMQTY, JOBTRJOBNUMBER, JOBTRJOBSHIPTO, JOBTRJOBNAME, JOBTRJOBTYPE
FROM JOBTRANSACTIONS where (JOBTRITEM = 'TESTING3');

This is not working in vb.net where chitem is the item variable:
sql2 = "SELECT JOBTRTID, JOBTRDATE, JOBTRUSER, JOBTRACTION, JOBTRCUSTNUMBER, JOBTRCUSTSHIPTO, JOBTRCUSTNAME, JOBTRCUSTCOMPANY, JOBTRITEM, JOBTRITEMDESC, JOBTRITEMQTY, JOBTRJOBNUMBER, JOBTRJOBSHIPTO, JOBTRJOBNAME, JOBTRJOBTYPE
FROM JOBTRANSACTIONS where (JOBTRITEM = " & chitem & ")"

I tried plus signs and no parenthesis without success.

The rest of the code is here. The error is on fill and it says that the
required value of a parameter has not been given.
I confirmed that chitem does have a value.

Dstran1.Clear()
Dstran1.AcceptChanges()
sql2 = "SELECT JOBTRTID, JOBTRDATE, JOBTRUSER, JOBTRACTION, JOBTRCUSTNUMBER, JOBTRCUSTSHIPTO, JOBTRCUSTNAME, JOBTRCUSTCOMPANY,
JOBTRITEM, JOBTRITEMDESC, JOBTRITEMQTY, JOBTRJOBNUMBER, JOBTRJOBSHIPTO,
JOBTRJOBNAME, JOBTRJOBTYPE FROM JOBTRANSACTIONS where (JOBTRITEM = " &
chitem & ")"
OleDbDataAdapter2 = New OleDb.OleDbDataAdapter(sql2, sConn45)
'Try
OleDbDataAdapter2.Fill(Dstran1.JOBTRANSACTIONS)
'Catch ex As Exception
'MsgBox(ex.ToString)
'Exit Sub
'End Try
Dstran1.AcceptChanges()
dsreport = Dstran1.Copy
reportdataset = "dstran"
If Dstran1.Tables(0).Rows.Count - 1 < 0 Then
MsgBox("No results found.", MsgBoxStyle.Information)
DataGrid1.Visible = False
sConn45.Close()
Button2.Enabled = False
Exit Sub
Else
Button2.Enabled = True
dv = Dstran1.Tables(0).DefaultView
DataGrid1.DataSource = dv
AddSizedColoredColumnsTran()
DataGrid1.Visible = True
DataGrid1.Refresh()
sConn45.Close()
End If

Nov 20 '05 #4
Thank you all you were exactly right.

"Jan" <ms****@tss.be> wrote in message
news:eJ**************@TK2MSFTNGP09.phx.gbl...
Hi Scorpion,

Try this (assuming JOBTRITEM is a stringtype field I suggest you add a
single quote before first double quote and another between second double
quote and the bracket) ......(JOBTRITEM = '" & chitem & "')"

Regards,
Jan

"scorpion53061" <sc************@yahoo.com> wrote in message
news:uy**************@tk2msftngp13.phx.gbl...
With an access database in vb.net.

This works in access:
SELECT JOBTRTID, JOBTRDATE, JOBTRUSER, JOBTRACTION, JOBTRCUSTNUMBER,
JOBTRCUSTSHIPTO, JOBTRCUSTNAME, JOBTRCUSTCOMPANY, JOBTRITEM,

JOBTRITEMDESC,
JOBTRITEMQTY, JOBTRJOBNUMBER, JOBTRJOBSHIPTO, JOBTRJOBNAME, JOBTRJOBTYPE
FROM JOBTRANSACTIONS where (JOBTRITEM = 'TESTING3');

This is not working in vb.net where chitem is the item variable:
sql2 = "SELECT JOBTRTID, JOBTRDATE, JOBTRUSER, JOBTRACTION,

JOBTRCUSTNUMBER,
JOBTRCUSTSHIPTO, JOBTRCUSTNAME, JOBTRCUSTCOMPANY, JOBTRITEM,

JOBTRITEMDESC,
JOBTRITEMQTY, JOBTRJOBNUMBER, JOBTRJOBSHIPTO, JOBTRJOBNAME, JOBTRJOBTYPE
FROM JOBTRANSACTIONS where (JOBTRITEM = " & chitem & ")"

I tried plus signs and no parenthesis without success.

The rest of the code is here. The error is on fill and it says that the
required value of a parameter has not been given.
I confirmed that chitem does have a value.

Dstran1.Clear()
Dstran1.AcceptChanges()
sql2 = "SELECT JOBTRTID, JOBTRDATE, JOBTRUSER,

JOBTRACTION,
JOBTRCUSTNUMBER, JOBTRCUSTSHIPTO, JOBTRCUSTNAME, JOBTRCUSTCOMPANY,
JOBTRITEM, JOBTRITEMDESC, JOBTRITEMQTY, JOBTRJOBNUMBER, JOBTRJOBSHIPTO,
JOBTRJOBNAME, JOBTRJOBTYPE FROM JOBTRANSACTIONS where (JOBTRITEM = " &
chitem & ")"
OleDbDataAdapter2 = New OleDb.OleDbDataAdapter(sql2, sConn45)
'Try
OleDbDataAdapter2.Fill(Dstran1.JOBTRANSACTIONS)
'Catch ex As Exception
'MsgBox(ex.ToString)
'Exit Sub
'End Try
Dstran1.AcceptChanges()
dsreport = Dstran1.Copy
reportdataset = "dstran"
If Dstran1.Tables(0).Rows.Count - 1 < 0 Then
MsgBox("No results found.", MsgBoxStyle.Information)
DataGrid1.Visible = False
sConn45.Close()
Button2.Enabled = False
Exit Sub
Else
Button2.Enabled = True
dv = Dstran1.Tables(0).DefaultView
DataGrid1.DataSource = dv
AddSizedColoredColumnsTran()
DataGrid1.Visible = True
DataGrid1.Refresh()
sConn45.Close()
End If


Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Henro V | last post by:
I am byuilding this database which (among others things) will have to produce a kind of calendar. Users give in the appointments they have and how long they take. F.e: John Doe is attending a...
4
by: pietlinden | last post by:
Hi, I have the sort of standard Donors/Donations DB. The twist I have is that donations can be time, money (which are easy, because they're additive), but then a donor can make an in-kind pledge,...
1
by: Luis Esteban Valencia | last post by:
Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source...
4
by: TB | last post by:
Hi All: As a newbie to ASP.NET, I think I have understood a dataset as a kind of container where I can store several datatables to used during the lifetime of a page. With that in mind I written...
5
by: koonda | last post by:
Hi all, I am a student and I have a project due 20th of this month, I mean May 20, 2007 after 8 days. The project is about creating a Connect Four Game. I have found some code examples on the...
2
by: rustyc | last post by:
Well, here's my first post in this forum (other than saying 'HI' over in the hi forum ;-) As I said over there: ... for a little side project at home, I'm writing a ham radio web site in...
7
by: Cirene | last post by:
I used to use the Web Deployment Project with my VS2005 projects. Now I've fully upgraded to VS2008. Do I have to download a new version of the Web Deployment Project? If so where can I find...
5
by: Simon | last post by:
I have problem with namespaces. I have a program that consumes the web service and has for instance names space nsProgram. In this program I have defined several classes that I use for storing and...
5
by: Bob Altman | last post by:
Hi all, Here's another rank beginner question. What is the standard way to fill a client-side table cell with a horizontal gradient background? TIA - Bob
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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.