Welcome, Guest |
You have to register before you can post on our site.
|
Online Users |
There are currently 2 online users. » 0 Member(s) | 1 Guest(s) Bing
|
Latest Threads |
Looking for Adventure? Fi...
Forum: Random Discussion
Last Post: iHOMEz
11-16-2024, 09:18 PM
» Replies: 0
» Views: 472
|
Prettys Womans in your to...
Forum: Random Discussion
Last Post: iHOMEz
10-30-2024, 07:45 AM
» Replies: 0
» Views: 748
|
Prettys Womans in your ci...
Forum: Random Discussion
Last Post: iHOMEz
10-26-2024, 10:50 AM
» Replies: 0
» Views: 780
|
Beautiful Womans from you...
Forum: Random Discussion
Last Post: iHOMEz
10-19-2024, 02:48 PM
» Replies: 0
» Views: 882
|
Prettys Womans in your ci...
Forum: Random Discussion
Last Post: iHOMEz
10-06-2024, 05:00 PM
» Replies: 0
» Views: 1,044
|
Womans from your city - V...
Forum: Random Discussion
Last Post: iHOMEz
07-28-2024, 10:26 AM
» Replies: 0
» Views: 1,418
|
Supreme Сasual Dating - A...
Forum: Random Discussion
Last Post: iHOMEz
06-14-2024, 11:28 AM
» Replies: 0
» Views: 1,843
|
Beautiful Womans in your ...
Forum: VB.NET
Last Post: iHOMEz
06-09-2024, 09:23 PM
» Replies: 0
» Views: 1,648
|
Hangman in Rust
Forum: Other
Last Post: brandonio21
02-04-2018, 11:14 AM
» Replies: 2
» Views: 20,639
|
How to: Search files from...
Forum: VB.NET
Last Post: brandonio21
11-25-2017, 12:55 PM
» Replies: 1
» Views: 15,957
|
|
|
Visual Studio Express vs Proffesional vs Ultimate |
Posted by: Derek275 - 12-01-2012, 06:22 AM - Forum: VB.NET (Visual Basic 2010/2008)
- Replies (2)
|
|
I was just wondering the differences and if it was worth the money to upgrade. Also, with anything better than express, in a project, can I make one firm in VisualBasic, another in C#, and yet another in F#? (Depending on my coding abilities on each language and what I need it for)
I just always saw Brandon using Proffesional and must other people on YouTube and was wondering what was so great about it.
|
|
|
How do I use Listview to delete MySQL DB records |
Posted by: kismetgerald - 11-25-2012, 09:52 AM - Forum: Programming Help
- Replies (10)
|
|
Hello everyone,
I trust you're all doing well. My application has come a long way and is almost complete - can't wait to share it with you guys. There are two things left to do - create reports, and the second is what I'm asking about in this thread.
So, here's what I want to do and don't know how to - hope you can help:
I want to create a functionality that allows me to retrieve records from the MySQL DB, store the results in a Listview control, then use that along with some buttons to delete individual records or multiple records (either based on selecting multiple rows or checking multiple checkboxes provided by the control). In either case, I want to be able to show a confirmation dialog box before executing the query that will delete the records.
I'm really looking forward to your assistance with this. I am willing to make the entire solution and DB available if necessary.
Thanks.
|
|
|
Listbox items text and text boxes? |
Posted by: Derek275 - 11-20-2012, 06:05 PM - Forum: VB.NET (Visual Basic 2010/2008)
- Replies (3)
|
|
Ok, I have I have a list box, kryptonListBox1, and a text box textBoxX1. I want to get the selected item in the listbox's text into the text box. My code is:
textBoxX1.Text = kryptonListBox1.SelectedItem.ToString
I've tried using .Text.ToString, but with both I get the error 'Object reference not set to instance of an object'
What am I doing wrong and what's the easiest way to fix it?
|
|
|
Reading and Wrinting XML Files |
Posted by: Snake_eyes - 11-17-2012, 06:35 AM - Forum: Code Snippets
- Replies (1)
|
|
Here is the most simple way to read and write an xml file with attributes and values.
For the sake of this example let's say we have an application that on form load creates toolstrip butons that when cliked load a web page on a web browser
First of all let's see the format of the Xml file
Code: <?xml version="1.0" encoding="utf-8" standalone="yes"?>
<root>
<ToolStipButtons>
<item Name="btn1" url="www.google.com" btnName ="Google" />
<item name="btn2" url="www.bing.com" btnText="Bing" />
<item name="btn2" url="www.yahoo.com" btnText="Yahoo" />
</ToolStripButtons>
</root>
In order for the code to work we need to import System.Xml
[code2=vbnet]Imports System.Xml[/code2]
Reading the xml file
Now let's see about reading the values from the xml file and creating the buttons.
[code2=vbnet]Public Sub CreateButons()
Dim Xml_Doc As New XmlDocument
Xml_Doc.Load(Application.StartupPath & "/AppSettings.xml")
Dim xmlNode As XmlNode
For Each xmlNode In xmlDoc.SelectNodes("/root/ToolStripButtons/item")
Dim NewBtn As New ToolStripButton With {.Name = node.Attributes("name").Value.ToString, _
.Tag = node.Attributes("url").Value.ToString, _
.Text = node.Attributes("btnText").Value.ToString} }
AddHandler NewBtn.Click, AddressOf NewBtn_Click
ToolStrip1.Items.Add(NewBtn)
Next
End Sub[/code2]
After this just create a sub named "NewBtn_Click" to handle the click event of the individual buttons
Writing the xml file
If changes occured to the ToolStripButtons and we need to save the new values to the xml file then we will use the folowing code:
[code2=vbnet]Public Sub SaveValues()
Dim settings As New XmlWriterSettings
settings.Indent = True
settings.NewLineOnAttributes = False
Dim Xml_doc As New XmlDocument
Xml_doc.Load(Application.StartupPath & "\AppSettings.xml")
Xml_doc.RemoveAll()
Dim Writer As XmlWriter = XmlWriter.Create(Application.StartupPath & "\AppSettings.xml", settings)
With Writer
.WriteStartDocument(True)
.WriteStartElement("root")
.WriteStartElement("ToolStripButtons")
For Each Btn As ToolStripButton In ToolStrip1.Items
'//Writes the Item Element
.WriteStartElement("item")
'// Writes the "Name" atribute and it's value
.WriteStartAttribute("name")
.WriteValue(Btn.Name)
.WriteEndAttribute()
'// Writes the "url" atribute and it's value
.WriteStartAttribute("url")
.WriteValue(Btn.Tag)
.WriteEndAttribute()
'// Writes the "btnText" atribute and it's value
.WriteStartAttribute("btnText")
.WriteValue(Btn.Text)
.WriteEndAttribute()
'// Writes the end of the item element
.WriteEndElement()
Next
.WriteEndElement()
.WriteEndElement()
.WriteEndDocument()
.Flush()
.Close()
End With
End Sub[/code2]
Now just simply call the CreateButons() on the Form_Load event and the SaveValues() in the Form_Closing event(or any other sub for that mater, depending on your needs).
I also recommend using Try/Catch blocks in order to catch any unwanted errors that might occur
|
|
|
|