476 Posted Topics

Member Avatar for justme369

Why not use the My namespace? [ICODE]My.User.Name[/ICODE]. It gives the name of the currently logged on user and would save you a whole shrew of coding.

Member Avatar for Oxiegen
0
105
Member Avatar for benhowdle89

First of all, I'm recommending that you download and install the MySQL Connector for .NET, instead of using ODBC. It's available from the MySQL site. Then, for inserting data into the database will be practically the same as using a MS SQL database. [CODE=VB] Imports Mysql.MySqlClient Private Sub MainForm_Load(yadda yadda …

Member Avatar for Oxiegen
0
106
Member Avatar for ahkaushi

Try this: [CODE=VB] Imports System.Data.OleDb Imports System.Text Public Class mainpage : Inherits System.Windows.Forms.Form Dim con As New OleDb.OleDbConnection Dim cmdOle As New OleDb.OleDbCommand Dim da As OleDb.OleDbDataAdapter Dim dtOle As DataTable Dim sql As String Private Sub find_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles find.Click con = New …

Member Avatar for Oxiegen
0
86
Member Avatar for oluscoa

(1) PHP has no real definition, ie: var $a_var;. In VB.NET you must define what the variable will contain, ie: Dim a_var As Integer Dim another_var As String (2) PHP uses the C syntax for iterations: for (var $i = 0; $i < 10; $i++) { } while ($a_var < …

Member Avatar for oluscoa
-2
178
Member Avatar for justme369

You might wanna look into the [URL="http://en.wikipedia.org/wiki/Simple_Network_Management_Protocol"]SNMP[/URL] protocol. However, it would be quite pointless unless your switches are of the Managed type.

Member Avatar for Oxiegen
0
105
Member Avatar for AngieK

You do need a licence for Visual Studio 2005 Professional Edition. But if you have already created a program using VB.NET, then you are the owner of said program and thus don't need any type of licence. So to answer your question: You don't need Visual Studio in order to …

Member Avatar for Oxiegen
0
162
Member Avatar for jackhadding

Your codesnippets look suspiciously at lot like this project: [URL="http://www.codeproject.com/KB/vb/toggleNetworkConn.aspx"]http://www.codeproject.com/KB/vb/toggleNetworkConn.aspx[/URL]. If you read through the authors documentation carefully you will see how to implement what you're looking for.

Member Avatar for jackhadding
0
471
Member Avatar for kayjenx

In Visual Studio 20005/2008 you can add a new connection through a wizard. At one point the wizard tells you that you've selected a local data file that's not in the current project, and asks if you would like to copy the database file to your project folder. Choosing NO …

Member Avatar for kvprajapati
0
183
Member Avatar for Dcurvez

[ICODE]combobox1.GetItemText(combobox1.SelectedItem)[/ICODE] returns the text for the currently selected item. This writes a line of string into a file. [CODE] Private Sub SaveToFile(fileName As String, data As String) Dim stream As New System.IO.FileStream(fileName, FileMode.Create) Dim sw As New System.IO.StreamWriter(stream) sw.WriteLine(data) sw.Flush() sw.Close() End Sub [/CODE]

Member Avatar for Oxiegen
0
848
Member Avatar for coolkeg

How about something like this. [CODE] Dim line As String Dim Input As StreamReader Dim PolicyIdCode As String Dim strFile As New ArrayList PolicyIdCode = TextBox19.Text Input = File.OpenText("Policy Details.txt") ' Loop through the file While Input.Peek <> -1 ' Read the next available line line = Input.ReadLine ' Check …

Member Avatar for Oxiegen
0
2K
Member Avatar for Chichano

Keep the newest/current version of the project in a database. Create a Webservice/WCF service that presents that version online and has a file copying method. Also, create a small Updater utility that goes with your larger project. Then add a reference in your project to the service, and compare the …

Member Avatar for Chichano
0
139
Member Avatar for Lee21

The ComboBox control has two properties called AutoCompleteMode and AutoCompleteSource. Change AutoCompleteMode to [B]Suggest[/B] and AutoCompleteSource to [B]ListItems[/B].

Member Avatar for Lee21
0
73
Member Avatar for bninja

[CODE] IF dataReader.Read() Then If Not IsDBNull(dataReader("dateColumn")) Then Dim dateTest As DateTime ' Test to see if the value in the database is a date If DateTime.TryParse(dataReader("dateColumn"), dateTest) Then If dateTest = DateTime.Now Then ' Do something End If End If END IF End If [/CODE]

Member Avatar for Oxiegen
0
223
Member Avatar for hannah39

'Code for retrieving the table from the database. TextBox1.Text = dataTable1.Columns(0).ColumnName

Member Avatar for Oxiegen
0
94
Member Avatar for ratnish kumar

One step at a time. Start by grabbing a pen and paper, and design the logic of your project.

Member Avatar for Oxiegen
0
46
Member Avatar for j_808

Something like this. [code] Private Sub CompareMonths() 'I don't know what DataSet.Repair is or does. Dim currentMonth As Integer = DateTime.Now.Month Dim parseMonth As Integer = 0 Dim parseDate As DateTime = Nothing ' Iterate all rows in table For Each row As DataRow In DataSet.Tables(0).Rows ' Check if field …

Member Avatar for j_808
0
114
Member Avatar for digozz

[CODE] Public Position As Integer Public Function Fibonacci() As Double If Position > -1 Then 'A for loop End If End Function Public Function Fibonacci(ByVal position As Integer) As Double ' A Do Until loop End Function [/CODE]

Member Avatar for digozz
0
80
Member Avatar for Lee21

Here's what I usually do, following Luc001's example. Add a handler for the FormClosed event. When you close the newly opened form, the event will be triggered and dispose of the object. And any future openings of the form will be with a fresh copy. [CODE] Public Class Form1 Private …

Member Avatar for Luc001
0
144
Member Avatar for Learner7

For ListView you should not use SelectedItems in this manner. SelectedItems is a collection of selected items (rows) in the ListView. So, if there's only 1 row selected then SelectedItems only contain 1 item. Therefore LVW.SelectedItems(1) will result in error. If you wish to retrieve values from the subsequent columns …

Member Avatar for Learner7
0
151
Member Avatar for guest11

I'm not entirely sure why you get the error. But I'm thinking you had the thought of using the index in [ICODE]Public Sub RedrawMap(ByVal index As Integer)[/ICODE] for something. Perhaps a layer or object index?

Member Avatar for Oxiegen
0
217
Member Avatar for brandy32

How about creating a class instead. That way you will be able to gather all calculations in one place. Here's a simple example. [CODE] 'In your form Private clsAddItem As AddItemClass Private Sub button_Click(ByVal sender As Object, ByVal e As EventArgs) Handles button.Click clsAddItem = New AddItemClass("book title") TaxLabel.Text = …

Member Avatar for brandy32
0
186
Member Avatar for meetarun007

If you Google with the keywords "vb.net gdi+ animation" you will find that there is a lot of guides and tutorials out there for how to accomplish this. Here's one, for example: [URL="http://www.freevbcode.com/ShowCode.asp?ID=5601"]http://www.freevbcode.com/ShowCode.asp?ID=5601[/URL]

Member Avatar for Oxiegen
0
156
Member Avatar for chukka32

You have two options. 1) Create an object with the scores and use serialization for storing into a file. [URL="http://www.switchonthecode.com/tutorials/csharp-tutorial-serialize-objects-to-a-file"]http://www.switchonthecode.com/tutorials/csharp-tutorial-serialize-objects-to-a-file[/URL] 2) Store the scores in the Registry. [URL="http://www.codeproject.com/KB/vb/registry_with_vb.aspx"]http://www.codeproject.com/KB/vb/registry_with_vb.aspx[/URL]

Member Avatar for Oxiegen
0
84
Member Avatar for joshslaton

Close, but no cigar. Try it like this instead. Notice that I removed some single-quotes and changed the plus-sign (+) into an ampersand (&). [CODE] ODBC_COM = New OdbcCommand("UPDATE President SET " & President_UPDATE_field.Text & " = '" & President_UPDATE_text.Text & "'", ODBC_CON) ODBC_COM.ExecuteNonQuery() [/CODE] Also. If you put it …

Member Avatar for Oxiegen
0
91
Member Avatar for jonniebl

Is the form you're trying to submit actually the form you stated on this line: [ICODE]WebBrowser1.Document.Forms(1).InvokeMember("submit")[/ICODE]? If the page only has one form, then the line should probably read: [ICODE]WebBrowser1.Document.Forms([COLOR="Red"]0[/COLOR]).InvokeMember("submit")[/ICODE]

Member Avatar for Oxiegen
0
4K
Member Avatar for ITGuy2010

A suggestion: Add a class variable of type List(Of Object). For each time you press the btnCalculate button you add totals(,) to that variable. Then iterate through the list and add it's content to a string variable that you display in a MessageBox. Example: [CODE] Private Sub example() Dim values …

Member Avatar for Oxiegen
0
154
Member Avatar for xfrolox
Member Avatar for bachan28

Yes, it is. You should look into using WMI. An example: [URL="http://www.freevbcode.com/ShowCode.asp?ID=4571"]http://www.freevbcode.com/ShowCode.asp?ID=4571[/URL]

Member Avatar for Oxiegen
0
64
Member Avatar for ana_eht

In your code for btnRemoveLine, do this: [CODE] If lstMenuItem.SelectedIndex <> -1 AndAlso lstPrice.SelectedIndex <> -1 AndAlso lstQuantity.SelectedIndex <> -1 Then Dim index As Integer = lstPrice.SelectedIndex lstPrice.Items.RemoveAt(index) lstMenuItem.Items.RemoveAt(index) lstQuantity.Items.RemoveAt(index) End If [/CODE]

Member Avatar for Oxiegen
0
141
Member Avatar for meowbits

How about this. Use the picturebox's Tag property and set it's values to a value that should go into these lines [ICODE]filled(0, [COLOR="Red"]0[/COLOR])[/ICODE]. Then you can do this: [CODE] Private Sub Change_Image(ByVal sender As Object, ByVal e As System.EventArgs) _ Handles PictureBox1.Click, PictureBox2.Click, PictureBox3.Click, _ PictureBox4.Click, PictureBox5.Click, PictureBox6.Click, _ PictureBox7.Click, …

Member Avatar for Oxiegen
0
122
Member Avatar for Lee21

Or if you prefer the datareader, here's how it's done. [CODE] Private Sub cboPosition_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cboPosition.Click scmd = New SqlCommand("SELECT KPIPOSTCODE FROM KKPIPOSITION", sqlcon) sqlcon.Open() scmd.CommandType = CommandType.Text dr = scmd.ExecuteReader(CommandBehavior.CloseConnection) If dr.HasRows While dr.Read If Not IsDBNull(dr.Item("KPIPOSTCODE")) Then cboPosition.Items.Add(dr.Item("KPIPOSTCODE")) End If End …

Member Avatar for verbalurbs
0
1K
Member Avatar for lifeworks

When you use LEFT JOIN, only those records from that table that matches are included and therefore counted. Perhaps this could be useful: [URL="http://dev.mysql.com/doc/refman/5.1/en/control-flow-functions.html"]http://dev.mysql.com/doc/refman/5.1/en/control-flow-functions.html[/URL]

Member Avatar for d5e5
0
83
Member Avatar for tukky

You need to encase All values in it's own single-quote and separate each column->value with a comma. [ICODE]UPDATE table SET col1 = 'value1', col2 = 'value2' WHERE col3 = 'value3'[/ICODE]

Member Avatar for Oxiegen
0
137
Member Avatar for carrzkiss

Try replacing some of the code with this: [CODE] Dim cn As New System.Data.SqlClient.SqlConnection("your connectionstring") cn.Open() Dim getUser As New System.Data.SqlClient.SqlCommand("select Username from MegaUsers where username=?", cn) getUser.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Username", strmegaun)) Dim resultsReader As System.Data.SqlClient.SqlDataReader resultsReader = getUser.ExecuteReader(CommandBehavior.CloseConnection) If resultsReader.HasRows Then While resultsReader.Read() Response.Write(resultsReader("Username").ToString()) End While End If resultsReader.Close() resultsReader = …

Member Avatar for carrzkiss
0
725
Member Avatar for Darkicon

Most likely problem lies within the DownloadFile method. Perhaps it's the WebClient that doesn't have access to the file your'e trying to download. Try adding some credentials to the client. [CODE] Dim cli As System.Net.WebClient cli.Credentials = New System.Net.NetworkCredential("username", "password") cli.DownloadFile("url to file", "local file") [/CODE]

Member Avatar for Darkicon
0
1K
Member Avatar for jonniebl

See what happens if you add the lines in red. [code] WebBrowser1.Document.All("body_plain").SetAttribute("value", Body1) [COLOR="red"]Webbrowser1.Document.InvokeScript("modified('body_plain',true)")[/COLOR] WebBrowser1.Document.All("keywords").SetAttribute("value", KeyWords) [COLOR="Red"]Webbrowser1.Document.InvokeScript("modified('keywords')")[/COLOR] [/code]

Member Avatar for Oxiegen
0
382
Member Avatar for ana_eht

If the items in the three listboxes share the same index, you can use the SelectedIndex property. [CODE] If listbox2.SelectedIndex > -1 Then listbox1.SelectedIndex = listbox2.SelectedIndex listbox3.SelectedIndex = listbox2.SelectedIndex End If [/CODE]

Member Avatar for ana_eht
0
98
Member Avatar for Darshana369

And likewise, you can also recieve mail through the same classes. Take a look at the SmtpClient class.

Member Avatar for kvprajapati
0
198
Member Avatar for daniss

Add and change the code in red. [CODE]Public Class MainForm [COLOR="Red"]Private intRetry As Integer = 0[/COLOR] Private Sub exitButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles exitButton.Click Me.Close() End Sub Private Sub PasswordTextBox_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles PasswordTextBox.Enter PasswordTextBox.SelectAll() End Sub Private Sub PasswordTextBox_TextChanged(ByVal sender …

Member Avatar for Oxiegen
0
148
Member Avatar for zulfahmi

[ICODE] Select R.*, P.HphoneNum, P.HeirHpNum from PendingReport R [COLOR="Red"]INNER JOIN[/COLOR] PatientTable P [COLOR="red"]ON[/COLOR] P.PatientID = R.PatientID [/ICODE]

Member Avatar for Oxiegen
0
90
Member Avatar for onaclov2000

Doesn't this all depends on how you place your monitors? One monitor is always the primary depending on which graphics port you use on your computer. In either case, perhaps you should take a look at the Screen class? More specifically the property AllScreens which contains a collection of all …

Member Avatar for onaclov2000
0
346
Member Avatar for betabasic

[CODE] Dim htmlElements As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("input") For Each el As HtmlElement In htmlElements If el.GetAttribute("name").Equals("sample") Then TextBox.Text = el.GetAttribute("value") End If Next [/CODE]

Member Avatar for Oxiegen
0
3K
Member Avatar for mfdengine18

[CODE] Dim FontName As String = "Arial" Dim FontSize As Integer = 14 Dim FS As New Font(FontName, FontSize, FontStyle.Regular) Me.Font = FS [/CODE]

Member Avatar for Oxiegen
0
181
Member Avatar for digitalsindhx

Perhaps something like this: [CODE] If txtSearch.Text.Equals("") Then PurchaseDt.DefaultView.RowFilter = "" Else PurchaseDt.DefaultView.RowFilter = "PUrchaseID=" & Integer.Parse(txtSearch.Text) End If [/CODE]

Member Avatar for Oxiegen
0
1K
Member Avatar for Lee21

[QUOTE=Lee21;1181957]Guyz I need help.. I'm a newbie in vb.net 2008..I have a form for User Account Maintenance and I want to transfer the Data of the specified Cell of the Datagridview once it's selected by clicking the mouse. How can I transfer it to textbox? Please help me.[/QUOTE] DataGridView has …

Member Avatar for Lee21
0
460
Member Avatar for ameyanatu

Is the Access database local on you machine or is it placed on a network share? If it's local then you need to include the .MDB file in the deployment project so that it too is copied along with your application. What tool are you using to create a setup?

Member Avatar for ameyanatu
0
101
Member Avatar for ameyanatu

First. If you are using a Primary Key in Access 2000, then you don't need to provide that in your INSERT statement. Access 2000 automatically adds a new record with a new Primary Key value. That makes all the records in the database unique. Second. There is probably a very …

Member Avatar for ameyanatu
0
114
Member Avatar for shroomiin

Create a new Class Library project. Then add a reference to System.Windows.Forms. Now you're free to add and design windows forms to that project. Compile. In your current project, add a reference to the newly compiled Class Library binary (dll) and you can call methods and show forms as usual.

Member Avatar for Oxiegen
0
118
Member Avatar for DelDemoire

[QUOTE] created a login system that works quite well, but I need using the db or settings or a variable keep the logged in staffid and username constant on all the forms through out the forms. I have no idea how to do this. as it is information that in …

Member Avatar for Oxiegen
0
154
Member Avatar for dudedatroz

As you probably know, viruses is not always a separate file with a file-extension but is mostly a part of an existing file on your computer as an "intruder". That said, take a look at this threat database: [URL="http://vil.nai.com/vil/default.aspx"]http://vil.nai.com/vil/default.aspx[/URL]. Here you can find almost(?) all known viruses with their name …

Member Avatar for dudedatroz
0
84

The End.