473,803 Members | 2,949 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Datalist with datagrid in vb .6.6

31 New Member
Dear All,

I,m doing a invoice project and in it i want to create both salesInvoice & purchase order

my Purchaseinvoice table contains following fields

1.InvoiceNo int primary key
2.Pdate datetime
3.Supplier Id varchar(10)(Thi s sup id should come from supplier table)
4.SupName(20)
5.ItemNo varchar(10)(Thi s following fields should from Product table)
6.Descrption varchar(20)
7.Purprice float
8.Qty int

my Product table contains followings fields

ItemNo varchar(10)
1.N1001
2.C909
3.F600
Descrption varchar(20)
Fan
Chair
Table
Supid int
1001
1009
1010
Purprice float
65.0
47.0
20.0
SalPrice float
75.0
55.0
30.0
QtyIn int
100
300
200
QtySold int
0
0
0


so the invoice form i created like this

Invoice No (TextBox) Pdate(TextBox)

SupId (DataCombo) SupName(TextBox )
''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '''''''''''''''
ItemNo Descrp Price Qty Gross

txtItemNo1.text txtdes1.text txtprice1.text txtqty1.text txtgross1.text

txtItemNo2.text txtdes2.text txtprice2.text txtqty2.text txtgross2.text

txtItemNo3.text txtdes3.text txtprice3.text txtqty3.text txtgross3.text


This is my form and i need to retrive the SupName from supplier table when i choose the datacombo SupId(i already binded) and i when i type and click the ItemNo in txtItemNo1.Text then i want to come all the description,Qty ,PurPrice to that corresponding itemno(i have 10 itemno with descrp,qty,pric e in the table)
from the Product table, so when i type the ItemNo in txtItemNo2.text the another
ItemNo will come it same for all txtbox

so i write the following coding in txtItemNo1.Clic k event
dim a as integer, dim n as string
a = 0
n = Val(txtItem1.Te xt)
adoproduct.Reco rdset.MoveFirst
Do While Not adoproduct.Reco rdset.EOF
'Do While Not EOF
'If adosupplier.Rec ordset.Fields(" SupId") = Val(n) Then
If adoproduct.Reco rdset.Fields("I temNo") = Val(n) Then
txtDescrp1.Text = adoproduct.Reco rdset.Fields("D escrp")
txtPrice1.Text = adoproduct.Reco rdset.Fields("P urprice")
txtQty1.Text = adoproduct.Reco rdset.Fields("Q tyIn")
a = 1
End If
adoproduct.Reco rdset.MoveNext
Loop
If a = 0 Then
MsgBox "Item No Mismatch"
End If
adoproduct.Refr esh

it,s not working and showed me the error msg

when i run my form it showed me the error msg

"Run time error 2147217842(8004 0e4e)
Opreation was canceled

and when i clicked the debug it showed me the only the 2 fields of the Product table
ItemNo's N1001-Purprice 65,QtyIn 100 but Description column in sql automattically deleted from the table, and if i type the ItemNoC909 in this txtbox with the same error msg it showed me the same value (65,100) if type the ItemNo in 2nd txtItem2.Text it showed me the error
but if i specify the itemNo as C909 in txtItem1.Text it didn't show me other column and directly goes to the EndIf statement and showed me the "Invalid ItemNo"Msgbox

so i take some datas from Product and insert in the new Pinvoice table


so whats the real problem and there is anything wrong in my coding plz tell me how can i solve this problem and instead of textbox how can i use datacombo to retrive the fields and what i should i do to solve this issue

plz i need ur help
Apr 15 '08 #1
0 1132

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

Similar topics

2
1250
by: acko bogicevic | last post by:
Hi I have a problem something like this I want to show in datalist customers but below to show orders for customer. I created datalist control and inside it i have to label for CustomerID and CompanyName and bind these labels without problems to dataset. But I do not know what to do next. Can i put the other data list in the first or something else and how can i bind it. Thanks a lot
1
4709
by: wsyeager36 | last post by:
I have a datagrid inside a datalist. The datalist shows parent info and the datagrid shows the child info for that parent. There is a checkbox on each row of the child datagrid. Also inside the datalist is a radiobuttonlist. When this radiobuttonlist is checked, I would like it to iterate thru each row on the child grid and either select or deselct the checkboxes (which are on each row of the child datagrid). In addition, the user can also check...
1
10932
by: bill yeager | last post by:
I have a datagrid control within a datalist control. When I try and do a "Find" on the control, the object comes back with nothing and then my pgm crashes. I am 100% sure that my datagird inside my datalist has an id of "Datagrid3". dgChild comes back with "Nothing" while debugging. Here is my code in the itemdatabound event for the datalist: <code>
8
2843
by: Nevyn Twyll | last post by:
I have a multi-level datalist setup: DataList1 DataList2 MyGrid I have columns explicitly defined for the grid in the html. Sometimes, On the initial Load() of the Page, I want to add extra columns to the datagrid - for all records. I tried getting a reference to the datagrid like this:
1
2182
by: DotNetJunkies User | last post by:
Hi, I was wondering if it is possible to load datagrid into datalist programatically using ITemplate interface with the following structure and place intp placeholder control. PlaceHolder - DataList - DataGrid (DataList Item) I have hierarchical data that I want to display using webcontrols whilst calculating minimum cost for each courier with Compute() method in DataGrid.
3
2789
by: CVerma | last post by:
Hi, I have an embedded datagrid within a datalist. I am not able to perfrom paging in the datagrid. Any ideas? Here is my code: Here is my Simplegrid.cs file: using System; using System.Collections; using System.ComponentModel; using System.Data;
6
2191
by: tshad | last post by:
I need to get to a status label I have on my footer section of my datalist. There is no event happening that would go to the footer. I am just doing some processing and want to update the label on the footer. At the moment, I go through the dataListItems like so: for each oItem as DataListItem in DataList1.Items trace.warn("inside for loop oItem type = " & oItem.itemType.ToString())
2
284
by: Eduardo Rosa | last post by:
Hello people, I'm using DataList to show some info from db (sqlserver), my question is about how make a button that call a function to do something using info from a line of the DataList. I explain: The code below will write a table with the values (from db) in their cells, what I want is a button (asp:Button) with onclick event using (some way) the cell datalist info.
1
1889
by: Brock | last post by:
First note that I am using Framework 1.1. I have an .aspx page that is displaying a list of employees, but only the Employee Number, First Name, Last Name, and Title. It is working great. I recessed it in a <Div></Divto allow scrolling of just the data, not the page. What I need to do is place a DataList (also in a <Div></Divto allow scrolling of just the data) to the right of the Datagrid to show 40 Employee Detail fields (listed top to...
1
1923
by: Brock | last post by:
Thanks in advance... (you can see a screenshot of what my form looks like currently at http://www.juggernautical.com/DataGrid.jpg - the Datalist is super-imposed in 'design view' but the DataGrid is the actual running of the page) I've almost got this working (?) but need a little help. I have an .aspx page that has a DataGrid listing employees with a "Select" button that is to be used to populate the DataList to the right of the DataGrid...
0
9703
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9566
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10300
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10069
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7607
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6844
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5503
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3802
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2974
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.