473,769 Members | 3,820 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Refreshing a Datagrid

lee123
556 Contributor
I know this is a free site and the moderators or anybody don't have to answer if they don't want to.. but if there is someone who knows how to answer this question please help with this one.

i have changed my project so many times to try to get the results i want but can't seem to get this one thing to work the datagrid and datalist to work right. i have looked on the web to see if i could do it another way. and read so many books but there isn't another way i have found i have searched this site but nothing but the posts i have left and certainly i won't find the answers there. Because it only has the same question posted. so i guess i will go through my question again.

I have made a program so when i pay a bill i can click on the name of the bill in the datalist. and only them bills for that name will show in the datagrid.

the way i have this set up is, i have TWO ADODC controls on the form. and one datagrid and one datalist.

the first ADODC control is for the DATALIST and the second ADODC control is for the DATAGRID.

the datagrid ADODC2 is connected to a database i have made with the "Visual Data Manager" called "BillDetail s" the connectionstrin g is connected to "BillDetail s" and the recordsource is to the table "DetailsT" which in the database i have these fields

BillID
AmountDue
AmountPaid
DueDate
DatePaid
ReferenceNumber
BillBalance
The "BillID" I have made a text field because i want to add my own ID's. I don't know if you can do this but i have.

the datalist ADODC1 is connected to a database i have made with the "Visual Data Manager" called "BillInformatio n" the connectionstrin g is connected to "BillInformatio n" and the recordsource is "SELECT * FROM DetailsT" the "ROWSOURCE" is to the ADODC1. the "LISTFIELD" is set to the "BILLNAME" the "DATASOURCE " is to ADODC1 the "DATAFIELD" is to "BILLNAME" the "BOUNDCOLUM N" is to the "BILLID" which in the database i have these fields

BillID
BillName
Address
City
State
ZipCode
PhoneNumber
The code for the DATALIST click event is this:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Datalist1_Click()
  2. Dim strQuery As String
  3. strQuery = "Select * FROM DetailsT WHERE BillID = " & _
  4. DataList1.BoundText & "'"
  5. With Adodc2
  6. .RecordSource = strQuery
  7. .Refresh   '<-----------'This is where i am getting the error
  8.                           'it's not refreshing the datagrid
  9. End With
  10. With DataGrid1
  11. .ClearFields
  12. .ReBind
  13. End With
  14. End Sub
So there it is i hope i can get a response for this

lee123
Apr 29 '09 #1
17 2553
QVeen72
1,445 Recognized Expert Top Contributor
Hi,

You have one extra single quote in your query..

In the Table if BillID is Numeric, then give your Query statement like this :

strQuery = "Select * FROM DetailsT WHERE BillID = " & _
Val(DataList1.B oundText)

If it is Text then :

strQuery = "Select * FROM DetailsT WHERE BillID = '" & _
DataList1.Bound Text & "'"


Regards
Veena
Apr 30 '09 #2
lee123
556 Contributor
Well I have Tried Both Ways And It Still Points To The "REFRESH" the error it gives me is (Syntax error in FROM clause)

lee123
Apr 30 '09 #3
lee123
556 Contributor
thanks for the response it took me awhile to figure it out but i got it working i have another question for you after i have click on a name in my list and the datagrid changes to that bill there are currency values in the the details database how do i show them in currency in the datagrid after i have click on a name. because right now when the form opens every bill is showing and i have set the currency value through the properties in the datagrid and it is currency.

but when i click on a name it goes back to normal. how do i change that

lee123
Apr 30 '09 #4
lee123
556 Contributor
i have got this working but i can't print out the datagrid in a txtfile so i would like to know how i can use the datacombo and textboxes for this instead, I mean is the code any different than the datagrid because i have 8 textboxes i would like to bind to it. so when i drop down the datacombo box it pulls the information that goes with the name..and fills the textboxes with the details

lee123
May 5 '09 #5
lee123
556 Contributor
please respond to this question....... ......

lee123
May 6 '09 #6
QVeen72
1,445 Recognized Expert Top Contributor
Hi,

Add Place the Textboxes on the Form, and Bind them to the ADODC,
by setting "DataSource " and "DataMember " properties of the textbox..

Regards
Veena
May 7 '09 #7
lee123
556 Contributor
ok i have the textbox already on ther form i have got the one adodc control bound to the datacombo (Information),

then i have Eight textboxes on the form as well for the (details) with another adodc control if i understand what your saying is i don't need the other adodc control?

Do I use both Adodc Controls for this? or just the one for the datacombo for all?

lee123
May 7 '09 #8
QVeen72
1,445 Recognized Expert Top Contributor
Hi,

I Guess, you are doing a Master-Detail format, then you will need 2 ADODC's.
You can Bind a Textbox (Or any) Control to Only one ADODC.
Check which adodc has the fields you are wanting to display, and bind that.

Regards
Veena
May 8 '09 #9
lee123
556 Contributor
well the thing is that i have these textboxes on the form but i want the company name from another table so when i choose a name the information will fill in the textboxes is this possible through code, through the one adodc control to get the name from the other table?

lee123
May 8 '09 #10

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

Similar topics

0
1347
by: serge calderara | last post by:
Dear all, I am develpping a .NET vb application fro 2000 and XP. I have actually an Collection list of Type, where type have 4 variables inside This collection list can be really long. I then pass the content of that collection list of type to a dat grid object which display them properly. The content of my collection list might change, it could be more records or
0
1754
by: msnews | last post by:
Hi -- I'm very, very new to ASP.Net, and I've been trying for several days to figure out how to update a datagrid AND refresh it on the client side so that the page doesn't refresh. I've torn my code apart over and over each time I tried what I thought would be the code that would solve my problem. Maybe I'm going down the completely wrong path here. Essentially, here is an explanation of my ASP.NET webform application and what I want...
5
2597
by: Jeff | last post by:
IDE: VS 2003 :NET OS: XP Pro My app have a form with a tab-control on it. The tab-control have 2 tabpages. One of the tabpages displays a datagrid, and the other tabpage displays details (order date, name, address etc) about the selected row in the datagrid... My problem is when I enter a new record in the details tabpage (saves data to database), and go back to the datagrid. Only the data from the PM-table
1
1584
by: Hans | last post by:
I have a Windows.Forms.Form containing a DataGrid where the DataSource is a DataView. Everything refreshes fine after adding, deleting or editing rows. When I close the dialog and reopen it with a new set of data, all is okay showing the new rows of data. But when I go back to the first set of data, I get the correct data except for ONLY the second column of the first row contains the data from the second set of data. If I cause it to...
7
3555
by: A.M | last post by:
Hi, I want to refresh my DataGrid data on every postback. I have following code in Page_Load event, but after first page load, the DataGrid never gets refresh. Here is the code i have in Page_load (it works at first page_load): Dim DS As DataSet Dim MyConnection As System.Data.SqlClient.SqlConnection
4
2131
by: Rod | last post by:
I posted a message to this group yesterday asking how to pass parameters to a web form that is the source of an IFrame on a parent web form. I've gotten my answer, and it works. Thanks! Now I have a different problem. The web form that is in the IFrame has a DataGrid in it. I have a button column in it which I use to trigger the deletion of the row in the database, and I want it to also reflect that deletion in the data grid. The...
1
2025
by: Jennyfer J Barco | last post by:
Hello I have a datagrid and a linkbuttom in the datagrid that says Picture, every time I click on the link "Picture" my program opens a popup window showing a picture of the item the selected and information about the item. On the html of the datagrid I have the following: OnItemCommand="Grid_CartCommand" OnItemCreated="DataGrid_ItemCreated". My VB functions are the following: Sub DataGrid_ItemCreated(ByVal Sender As Object, ByVal e As...
1
1818
by: pv_kannan | last post by:
One of our dev team members is having a strange problem with a datagrid... We are not seeing a datagrid's data getting refreshed after a new row is entered in a popup window inspite of resetting the datasource and rebinding it. We have a datagrid (enabled viewstate) that binds to a collection class that inherits the IList interface. The datagrid displays list of associated contacts for a customer order.
0
1274
by: rraw | last post by:
hello! i have a poblem refreshing the datagrid the datagrid gets updated but what should i do in order to make the grid invisible once i am thru the dataviewing from the datagrid.. plz help me out
0
9420
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,...
0
10205
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10035
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9984
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
8863
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6662
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();...
1
3949
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3556
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2811
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.