VS 2008 Will Not Need To Update Each Component Variable Of Products List When Components List Changes
Sep 21, 2010
I think (?) this is about object design, and perhaps about structural and/or creational patterns. But a bit hard to say when I only know a couple of patterns yet.[code]But... what if we INSTEAD want each Product instance only to (in some way) refer to one instance of a specific list of Components. So we wan't to save the products list to one file, and the components list to another file. Then would I build the objects the same way, or different? So let's then say we have now Class B as below. [code]
1. Will not need to update each component variable of the products list when the components list changes.
2. If the Product object shall be shown in a DataGridView, for editing properties, it seems easier to implement the selection of the component property.
Is this wrong approach? Is it suitable in some cases, and if so, when? Are there other solutions I perhaps am not aware of that would be appropriate? Is this about structural design patterns? and if so, can the alternatives above be catagorized to some pattern type? I don't really know exactly what I'm looking for.. But I think probably I'm looking to understand whether the object design will be determined by the way the objects are saved.. And if i shall save the objects by serializing to file, vs saving to a database, would I create the business objects differently?
I'm basically brand new to LINQ. I've seen some examples that allow me to strong type objects using LINQ but I don't really understand them because they're in C#, which I guess lets you do different things with LINQ(I think?). [Code] I just want to get a list of all the products from the XML doc and put them into a Generics list.
I'm trying to make the following snippet work in VB6 but it's one error after the other. can anyone make heads or tails of this?
Basically i'm after a little proggy which will store the names of a couple of products, calculate product code (first three and last three characters of product name) produce a list of products stcked with their initial stock levels, allow info on products be search for, allow the products to be purchased.
One is a program where you can select a product and select how many of them you want. Then the total price wil be displayedin a label. And the list of selected products will be saved in a .txt file.
The second program is an Edit program. The user can edit his selected products. Here he can change the total of a product.So if he had selected 1, he can change it to three or something. When the user clicks the button Save. The changes will besaved in the same .txt file and the total price will also be changed and displayed in program one.
Program one is compleet.Program two has problems and here i need your help:- the user can't make a change in the numbers, seems that the textbox is read-only or something. How to solve?- Then when i click save, the changed must be saved in the .txt ( i can't test this yet because no changes can't be made)- the total new price must be showed in program 1 (i think i programmed this well, but can you take a look)
I am making a minor basket system which the user selects a number of products from a datagrid and it adds them to a basket using an array list (arrItemID).However on the ViewBasket form I want another datagrid however a query is formed listing the selected products. Though the datagrid seems to be empty (though the query when outputted to a text box is ideal. [code]
Trying to build a project that lets users click an item from a list of products (tabbed form). Once an item is selected (check box) find a way to store that item.Then when the user has finished selecting items they can click a button showing what they have selected in a new form that will open.Whats the best way to store what items they select? An Array?
Give me some kind of tutorial for using the FB API with VB.NET (2008). I tried installing the SDK, but the components don't show up in the toolbox nor in the 'Choose Items' List...
Dim x = GetType(List(Of )) 'valid statement Dim list As New List(Of String)
Now I want to see if list is a List(Of T) variable: Dim isList = TypeOf list Is List(Of ) On the last line I get a compile error: "Type Expected". Is there any cheap-performance TypeOf operator alternative for generics?
This is what I'm sure will be the first of many noob-ish questions from yours truly... I'm studying as a mature student for a Computing Degree (encompassing web design, hardware, programming and systems analysis). The programming seems to be my weak spot this year. I enjoyed C++ last year, doing basic console applications, but progamming visually with VB in Visual Studio 2008 I'm struggling!
I have a small problem i'm trying to fetch list of directoies from 1 special ftp server wich does not support LIST command i was try this code and it works for all ftp server i have try exept this special one :
'' Get the object used to communicate with the server. 'Dim request As FtpWebRequest = DirectCast(WebRequest.Create("ftp://" & txtFTPhost.Text), FtpWebRequest)
[code]...
I'm getting error 502 which means command is not supported and app crashed. I would just simple said leave it but i have try normal ftp clients like FlashFXp and it works just fine (i can see error in the log but it just pass it and show direcoties)
Ok i'm trying to declare a global list of type T (or is it <anonymous type>) i declare it in a module with something like Friend query As New List(of {whatever type i try}) the app takes some xml and parses it into a list but i need this list available to other classes and methods within the app, everything i have tried fails resulting in an error like Value of type 'System.Collections.Generic.List(Of <anonymous type>)' cannot be converted to 'System.Collections.Generic.List(Of {whatever type i try})'.
What would be the correct way to declare a list of this type? is there another way i could do this?
i want to search item A (from a list of X items) in list B but i want to get the item not found example Search ITEM A in LIST B if not found then return a print....if found continue with ITEM B..and so on.
Firstly i apologise for another topic on a subject i have created already but this is a slightly different question and not related to LINQ at all despite the fact the code uses LINQ (the linq works fine and creates a List(Of Test) where each 'Test' contains a List(Of TestList) This data could be anything i guess and could come from an array or a database rather than xml literals.Ok, essentially i have a list which contains a list and i wish to display all the properties (List and list within this List) onto a DataRepeater Control. I have developed a testbed to get this working so i can implement it into my main application. Firstly I'll show the current code and how to construct the form and after that i will explain what i have tried and what i have had happen from these trials over the last week.
Public Class Form1 Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
i am trying to 'Update' an item in a list The idea i was try to use was going to be to remove the item then add it again. so far this is the code i have
[code]...
The problem i am having is here,Tempcarmake has a Make property which holds the car make eg Honda, Ford, VW i want to find the item in the that has the same Make as the TEMPcarmake that the user has been using
I've been fooling around with this for two hours and getting nowhere. I want to update a list box on a form with some text. Unfortunately the event that calls for the update is a timer which gives me a cross thread error.The listbox relies on a combo box which tells it the number of items to display. Here's my sub that performs the update.
Public Sub EventUpdate(ByVal EventMsg As String) Dim DateTimeStamp As String = Format(DateAndTime.Now, "MM/dd hh:mm:ss") With lbxEvents
The reason I ask is if I use syntax like this, I tend to get a string to whatevever conversion error, which makes me think "variable" is being treated literally as a string.
How do I make options in a drop down list display variables? For example this is what I would like to have done:-in form1, a user types seven words into 7 text-boxes.-in form2, a user clicks on a drop-down list to select one of the words that was previously typed in to a txtbox in form1.
Public strDBData As New List(Of SearchDatabases) Public Structure SearchDatabases Public strName as String
[code].....
If you need to know what i'm doing this it it:I'm parsing a webpage that lists information such as; Name, Site URL, How many members etc.And thats fine, but i want to put the names in a listbox, and then when the user clicks a name in the listbox it displays the other data about that name such as the site URL and how many members they have.This is easy to do but i have made my listbox sorted so the names display alphabetically, so then my strDBData index's don't line up correctly, to fix this i need to sort the
I'm working on a project for a client (he wanted it in VB.NET so I dont have a choice) and have hit a wall. I have a Product class, and a List(Of Product) that I'm using to store products in while a new order is being built. The problem I'm running into is updating the Quantity value of a product if it's found in the list (instead of adding the product again).
I'd like to write an app that would allow users to modify existing records in a WSS sharepoint list and/or create new records.I feel confident that its possible, but I just don't know exactly how. Sharepoint access, for me, is accessed with domain credentials, so I"d need some method for getting those from the user, in the winform, and passing those along to the WSS server.
I'm working with Windows Forms - VB.NET.Here's what I have:
A ListView with checkboxes set to True A Button (triggers the update) A database table with similar fields as the ListView
What I want to happen:when the user clicks the Button, all items on the ListView with checkbox checked will be updated.My progress:I've already collected the ID of the checked items and stored them in an array. I'll be using this to update the database table.I don't know how to put them in the SqlCommand.Parameters Also, I don't know the update command for such scenario (where in/exist (@parameters))
Not sure if I have the correct subject line. Here is my issue. I have a form with 2 GridView. One GridView has a list of all zipCodes. The users is to select a location from a dropdown list, then select the zipcodes he/she wants to be assigned to that location and then click the "Add" button. The zipcodes then appear in the second GridView. When the user clicks the "Save" button, the data is sent to the database. The is also a "Remove" to remove zipcode(s) in the second GridView.
How do I track changes only in the second GridView. There could be 1000's of zipcode in the second GridView. Do I just remove and re-insert the list for that location evertime the user click save? I was thinking of using a DataSet, add DataRows and then update, however I am not using a DataAdapter to load my dataset, so there is no way for me to use DataAdapter.Update(ds). I am using the SQLHelper.ExecuteDataset(parms)
I have a textbox which will accept a user input for a email address or phone number.I want to using a new thread do a search for various results and populate a listbox.I know i need to do this in another thread so my main form will still operate but how can I do this? I've never used threads before and I know it's tricky to get the values from a textbox and also update a list box on another thread.
A ListView with checkboxes set to True A Button (triggers the update) A database table with similar fields as the ListView
What I want to happen:
when the user clicks the Button, all items on the ListView with checkbox checked will be updated.
My progress: I've already collected the ID of the checked items and stored them in an array. I'll be using this to update the database table.
The problem: I don't know how to put them in the SqlCommand.Parameters Also, I don't know the update command for such scenario (where in/exist (@parameters))