
Denaes
Avatar/Signature-
Posts
975 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by Denaes
-
I'm not sure about a collection. I'd load everything from the collection into a datatable and use a dataview to filter/sort it all. Thats what I did and it works perfect. A DataTable is also a collection and you're not limited to the number of rows.
-
.Net is now multiplatform... for the price of your soul!
Denaes replied to Denaes's topic in Water Cooler
Well, which version? I think there are like 10-15 major versions and about a hundred times as many minor versions. Some are very similar, some are radically different. Some are all command prompt like dos, with others you need to search to find the command prompt, its hidden under the GUI so well. If you want an "Easy" Linux experience, you might want to try Lindows. Its a linux implimentation of windows, ment for novices/windows users. you can find it at http://www.lindows.com, and it also ships with cheap $200 PCs from walmart (got one for my mother-in-law, but lindows didn't work with the monitor we had, so we had to install windows 2000 anyway, nice computer for the price, if cheap perriphials. The mouse was crap). This is so Windowslike that the linux community as a whole pretty much hates it a little more than windows. Its worse because its Linux tying to be windows! I can say a lot of bad things about windows and have a lot of annoyances, but PlugNPlay sure as hell beats writing your own configuration for each device. For the most part, I want to spend my computer time being productive, not fiddling with the OS to try to make it work. -
Ok, I can collapse categories. When I leave and come back, they stay collapsed. If I collapse the side panel and come back, its at full size again. Is there a way you can choose to have it collapsed and save it like with the forum categories?
-
Thats something VERY good to know! :D I'm not sure how many people will be up to 2 million records, but its always good practice to use the best tool for the job.
-
What do you mean by languages? German, Spanish, Russian or J#, C#, VB
-
Argh. I'm on crack. I got half the name right. It's called Scheduled Tasks, its in your Control Panel (unless you have 98/2000/XP lite, which allows you to remove it) You just open it up, double click on Add Scheduled Task. Then you get a standardized list of installed programs (like when you choose file extension associations). You click "Browse..." and tell it were to find your .exe file. You then get a choice of what you want to call the Scheduled Task and a choice to perform the task "Daily, Weekly, Monthly, One time only, When my computer starts, When I log on" From there you should be able to configure it to your likings. I say to practice with it by setting it a minute ahead of what time it is to test it. Mine at home had no problems. At work, there was some issue with it needing the computers admin name/password and it took like 9 tries to get it working.
-
I'd just open up the Task Manager and set to run every day at noon. :D If you want to do it via .Net, you'd have to have the actual program running 24/7 and constantly checking the PC Time like once every second or so... maybe every 10 seconds and wait until it's past noon, then run the procedure. You could also create a launcher program, which would act like Task Manager, watching the time, then running X att at X time
-
Do you use the ADO Recordset because you prefer to, or is that required to use mySQL? This looks like good stuff. I'm looking into the mySQL as a low cost alternative to SQL Server for a future project which may be in VB.Net or possibly ASP.Net as it requires a "server" computer and many clients. I'm leaning more towards using ASP.Net over an intranet. Unfortunately that's a future project, so I really can't get into it fully. I have this thread bookmarked and at least I know it's in fact possible and how to get it started. Thank You :) [edit]I changed the PHP markup tags to VB markup tags. -Derek[/edit]
-
Which is better to use, vbCRLF or Environment.NewLine? All the books I have use vbCRLF. I guess Environment.NewLine is the .Net managed way to do it?
-
vbCRLF is Visual Basic's "Carrage Return & Line Feed" "This is line 1" & vbCRLF & "This is line 2" would have two lines. Just make sure your multi-line property is set to True. Sorry if I mistook your inentions in the first post :p
-
Nope. You can make one yourself though by extending the base textbox and making your new control for it. Wether you want to make a new one entirely or just add it to your project, you'll need a collection. In the collection you can add an item or an item and a string (like a name for it) You can get the information from your collection via its index (automatically indexed) like a listbox, or if you gave it a string "Key", you can get it back with that. Note, you can also use a combobox. There are three 'dropdown' methods, two allow you to put in text. The first option is flat out just a textbox with a scrollable (by pushing up/down I believe) combo list, it has no actual dropdown.
-
My #1 concern is that its a standalone program without needing an "Installation" onto a machine. You just stick in your jump drive/floppy/zip disk and get to work. .Net is very capable of this sort of "Uninstalled Program", but requires the .Net framework to run. Only XP sp1 comes with .Net as a standard option, anything else, you have a 98% chance that the Framework won't be on it unless you put it there, which isn't always possible.
-
That is, indeed, a good solution for liscensing issues, saying you stick with C# and are willing to trust a third party compiler to do everything properly without error. But its not portable and is probobly just as extensive reasourcewise and installationwise as VS (or at least VB.Net, a single language deal)
-
What does it take to cause a DataSet to "Have Changes"?
Denaes replied to Denaes's topic in Database / XML / Reporting
In case you missed it, I wrote up a 'lil tutorial, which I hope will help those learning all of this. I know I had a rough time with it :D http://www.xtremedotnettalk.com/showthread.php?p=410429#post410429 -
Editing the DataTable Editing the DataTable Private Sub EditRow() 'Notice how this looks nearly identical to 'The NewRow Sub? Same idea, but a few minor 'tweaks. 'I use a datarow to store the changes. 'This allows for later uses of verification, 'accepting and rejecting a seperate DataRow 'Rather than adding directly to the DataSet. Dim CurrentRow As DataRow 'CurrentRow is set to be equal to the current record, 'by way of getting its position as we did earlier. CurrentRow = DataSet.Tables("Customers").Rows(Me.BindingContext( _ Me.DataSet.Tables("Customers")).Position) 'This is exactly the opposite of what we have 'done to populate our textboxes. 'Instead of setting the textbox to be equal to the 'Field in the DataTable, we're setting the Field of 'the DataRow to be equal to the text in the textbox. With CurrentRow 'Because its an edit, you want to start your edit 'with the .BeginEdit method to tell the datarow that 'editing has begun. .BeginEdit() .Item("LastName") = Me.txtCustLastName.Text .Item("FirstName") = Me.txtCustFirstName.Text .Item("PhoneNumber") = Me.txtCustPhone.Text() 'This signifies the end of the edit. 'This also, without a doubt, tells the dataset that 'a change has been made. 'As an alternative, .CancelEdit will undo the edit. .EndEdit() End With 'If needed, this is were final verification of the data, 'checking for errors, a chance to accept/reject the 'DataRow. 'And we insert our new DataRow into the Customers 'DataTable. DataSet.Tables("Customers").Rows.Add(NewRow) 'This would be a good place to update the DataSource '(Database) unless you want to make multiple additions ' and edits before making a single save. End Sub
-
This "tutorial" assumes that you already know how to populate your dataset in some way and is already working with a full dataset. Note: Personally I do my work with Typed Datasets which signifigantly shorten the code and reduce errors when dealing with a dataset. This code works 100% with my Typed DataSet, I hope I didn't introduce any errors by working with an untyped dataset. Displaying Data The easiest way to display data is to set the datasource of a control to the datatable: Listbox.Datasource = DataSet.Tables("TableName") and choosing a DisplayMember: Dataset.DataMember = DisplayMember = DataSet.Tables("TableName").Columns("ColumnName").ToString The DataSource is pointed to a DataTable to display. In some cases, like a DataGrid, the control can display all the columns and no DisplayMember is required. In a ListBox, however, you can only display one column. The DataMember is the DataColumn you wish to display. Creating a DataBound control is a lot easier for viewing. I personally have learned to not fully trust it for editing and adding new data. Once you databind a control, you loose some of the control's properties. A DataBound ListBox cannot use the .Sorted property to alpabetize the data. You also cannot play with the .Items collection without throwing an exception. When I want to "play" with my data, like adding new rows, editing and deleting (In the work I do, deleting is a four letter word and isn't done lightly, ie only the Admin will do it, not the end user), I use a different method of binding the data to a control. This is the display procedure I'm using currently to display data into the textboxes for viewing: Private Sub DisplayDataset() 'Me.BindingContext(DataTable).Position is a Property that returns 'the current index of the DataTable. As a property it can also be set 'to another value and changing the current index. With DataSet.Tables("Customers").Rows(Me.BindingContext(Me.DataSet.Tables("Customer")).Position) 'See, instead of being databound to a column automatically, 'we're just giving the textbox the text from a column in the 'row that is currently selected. Me.txtCustLastName.Text = .Item("LastName") Me.txtCustFirstName.Text = .Item("FirstName") Me.txtCustPhone.Text() = .Item("PhoneNumber") End With End Sub That shows us how we're going to display our data. Here is how we're going to Load our data: 'This goes in the Form Load event (or a button event), which loads the data for the end user to see. 'This sets the current index to 0, the first record. Me.BindingContext(DataTable).Position = 0 'This calls the procedure to display our data DisplayDataset() Navigation is just as easy: 'First Record Me.BindingContext(DataTable).Position = 0 'Last Record Me.BindingContext(DataTable).Position = DataTable.Count-1 'Next Record - gets a little trickier With Me.BindingContext(DataTable) If .Position = .Count - 1 Then 'Position cannot become greater than the number of records. Else .Position += 1 UpdateDisplay() End If End With 'Previous Record - more of the same, just in the 'opposite direction With Me.BindingContext(DataTable) If .Position = 0 Then 'Position cannot become < 0 Else .Position -= 1 UpdateDisplay() End If End With Of course after every change of the BindingContext.Position, you need to update your display by calling DisplayDataset Adding a New Record First off, when someone attempts to add a new record, there are normally a few things you want to do. 1. Disable Navigation. You normally don't want the user to change the record. 2. Clear out old data. Just a simple procedure to get rid of the data in each of the textboxes will suffice. 3. Possibly a confirmation of some sort, like a MsgBox. 4. Check the data being entered. Obviously you can't enter a 500 character string into a 50character field of a database, you may not want text in the phone number field, etc. Ok, now the meat of the procedure. We have the data we want in the input form. The LastName is in the txtCustLastName textbox, the phone number is in the proper textbox. The data has been checked to make sure it will go into your database properly (if applicable) Private Sub SaveNewRow() 'I use a datarow to store the changes. 'This allows for later uses of verification, 'accepting and rejecting a seperate DataRow 'Rather than adding directly to the DataSet. Dim NewRow As DataRow 'This sets the NewRow to an instance of the '"Customers" table's .NewRow method. NewRow = dDataSet.Tables("Customers").NewRow 'This is exactly the opposite of what we have 'done to populate our textboxes. 'Instead of setting the textbox to be equal to the 'Field in the DataTable, we're setting the Field of 'the DataRow to be equal to the text in the textbox. With NewRow .Item("LastName") = Me.txtCustLastName.Text .Item("FirstName") = Me.txtCustFirstName.Text .Item("PhoneNumber") = Me.txtCustPhone.Text() End With 'If needed, this is were final verification of the data, 'checking for errors, a chance to accept/reject the 'DataRow. 'And we insert our new DataRow into the Customers 'DataTable. DataSet.Tables("Customers").Rows.Add(NewRow) 'This would be a good place to update the DataSource '(Database) unless you want to make multiple additions ' and edits before making a single save. End Sub
-
.Net is now multiplatform... for the price of your soul!
Denaes replied to Denaes's topic in Water Cooler
-
What does it take to cause a DataSet to "Have Changes"?
Denaes replied to Denaes's topic in Database / XML / Reporting
Problem fixed. I was altering the datatable itself. I switched to using a datarow and using the .BeginEdit and .EndEdit, which it looked like someone was alluding to. Thanks for the help :) -
.Net is now multiplatform... for the price of your soul!
Denaes replied to Denaes's topic in Water Cooler
I'm waiting for two things to make a move to OS X or Linux. A professional (ie, fully implimented and few bugs) .Net IDE. Macromedia Flash (preferrably the whole Macromedia Studio). OS X already has the whole Macromedia Studio, but I see no plans in any forseeable future of it getting a professional .Net IDE. Linux has neither, but is promising both. Macromedia is helping to support Macromedia Flash emulation on WINE (Windows Emulator for Linux) and looking into developing a native Flash (or whole studio) support for linux. Linux also has that .001 beta of a C# IDE, so theres a real possibility. Other than that, what do I use a computer for? Watching movies? Internet? Buisiness Bookkeeping? All that is already possible on Linux. I just need to make sure my All-in-one printer/scanner/fax is supported and I think I'm set to go. But programming is my primary use for my computer and both Flash and .Net both solve different problems. -
Oh, so return exits a procedure/function? VB has Exit.Sub, Exit.Loop, Exit.If Does return do all of that? Just exit you out of your nearest clause?
-
.Net is now multiplatform... for the price of your soul!
Denaes replied to Denaes's topic in Water Cooler
For the most part, deploying a .Net project is just copying a directory with your program in it. The Mono would handle the copy operations in theory. You might need to learn some conventions... Isn't Linux not allowed to have spaces in filenames? Stuff like that. Mono should act as the inerpreter and all the developer would need to do is code in a .Net language or IL and mono will do the rest. -
C# is different. It's very close in formatting syntax, but you're using a managed .Net language, so the actual code won't be C, but .Net. You do still have ";"'s after each line and brackets to close procedures and if...then cases, etc.
-
.Net is now multiplatform... for the price of your soul!
Denaes replied to Denaes's topic in Water Cooler
-
Thats a whole 'nother question which is a much different beast than the first. You asked about 5 buttons on the same form. Now you're starting to get into Delegates, event listeners etc. If you're not hardcore into OOP, I'd suggest just using a public subprocedure somewere (like in a module) and just call the procedure from each of the 5 button.click events. Public Function ShowButtonText(ByVal btn As Button) As String Return btn.Text End Function Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click MsgBox(ShowButtonText(Button1)) End Sub personally I think in this case, as you presented it, it would just be easier to write one line of code in each of the buttons click events Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click MsgBox(sender.text) End Sub Every way I can think of doing it differently involves much more code... Anyone have a simpler idea?
-
I too couldn't get it to accept focus. Picturebox.TabStop = True Picturebox.TabIndex = 0 should cause it to start with focus. It isn't doing so. Any reason you can't just Add a dummy control, like a textbox or button, behind the picturebox? Then when btnPicFocus gets focus, you can set the pictureboxes border to be different (if you want to) and do whatever it is you wanted.