4,911 Posted Topics

Member Avatar for EmpK

The easiest way to write out the text is System.IO.File.WriteAllLines(filename, {empIDbox.Text,fnamebox.Text,lnamebox.Text,salbox.Text}) To read it back Dim text() As String = System.IO.File.ReadAllLines(filename) If text(0) = txtUpdateID.Text Then txtUpdateFirstName.Text = text(1) txtUpdateLastName.Text = text(2) txtSalupdate.Text = CInt(text(3)).ToString("C2")

Member Avatar for xerohomicide
0
230
Member Avatar for pratik65

Check out [How Do I Put a Number Limit on a TextBox](http://www.daniweb.com/software-development/vbnet/threads/440145/how-do-i-put-a-number-limit-on-a-textbox)

Member Avatar for Reverend Jim
0
112
Member Avatar for EmpK

If txtUpdateID.Text = False Then Will never work because you are comparing a string to a boolean. The short form of showing/hiding a label depending on a comparison is Enflbl.Visible = txtUpdateID.Text = "some string value" If txtUpdateID.Text is equal to the string value then the label is shown, otherwise …

Member Avatar for Reverend Jim
0
188
Member Avatar for EmpK

>If TextBox1.Text > 1500 Then Doesn't work because you can't directly compare strings and numbers. Also If TextBox1.Text > "1500" Then won't work because "2" > "1500". If you limit your textbox to entering numbers only then you can do If CInt(TextBox1.Text) > 1500 Then To restrict a textbox to …

Member Avatar for EmpK
0
748
Member Avatar for Dani

Well happy birthday to you. I'm almost double that myself but my son at Stony Brook is just one year younger than you.

Member Avatar for Mike Askew
6
761
Member Avatar for LastMitch
Member Avatar for savedlema

As far as I know, Access does not support temporary tables. However, you can create a table on the fly with SELECT INTO as in SELECT * INTO temptable FROM Customers WHERE Address LIKE '*C*' Just remember to drop the table when you are done.

Member Avatar for savedlema
0
392
Member Avatar for Reverend Jim

This request arose from the discussion [OPINION: Who thinks MAKING A POST on these forums is horrible](http://www.daniweb.com/community-center/daniweb-community-feedback/threads/439477/opinion-who-thinks-making-a-post-on-these-forums-is-horrible). My comment on that thread was >If I am not logged in and I click on a link in my email, I am taken to that post. I can start typing a response …

Member Avatar for Mike Askew
0
167
Member Avatar for vicky30312

You can simplify the coding and make it more obvious by using this pseudo-code. It eliminates some unnecessary testing and setup. set low and high range for guess (lo=1 hi=100) read user number loop calculate guess as hi - (hi-lo)/2 if this is the correct number then exit loop if …

Member Avatar for Reverend Jim
0
286
Member Avatar for ProgenitorVirus
Member Avatar for Reverend Jim
0
132
Member Avatar for shhh

You are displaying the message, "Connection Established" before you even try to open the connection. I suspect you haven't specified the server name correctly. On my machine (using MS SQL) it is "Server=.\SQLEXPRESS;". When I try with either "Server=localhost" or "Server=(localhost)" I don't get the connection. Try this (with a …

Member Avatar for Reverend Jim
0
123
Member Avatar for Dili1234
Member Avatar for Reverend Jim
0
137
Member Avatar for SQLpower

Execute the SQL reader before you check if there are any rows, then step through the records and populate the combobox as in Dim dr As SqlDataReader = SQLcmd.ExecuteReader If dr.HasRows Then Do While dr.Read() cmbName.Items.Add(dr(0)) Loop Else MsgBox("no records") End If

Member Avatar for SQLpower
0
190
Member Avatar for Dili1234

You have another table which uses that primary key as a foreign key. If you delete that record then the other table will have an orphan (a record that doesn't point back anywhere). If you are using MS SQL you should be able to set up something called **cascading referential …

Member Avatar for Dili1234
0
131
Member Avatar for nitin1

I found that cramming right up to the exam time just got me extra wound up. What worked for me was to stop preparing a few hours before the exam, show up to the exam site an hour early with a cup of coffee and fine some place close by …

Member Avatar for kemcar
0
127
Member Avatar for SQLpower

Try changing strQuery = "INSERT INTO login (username, password) values (" & txtUser.Text & "', '" & txtPwd.Text & "');" to strQuery = "INSERT INTO login (username, [password]) values ('" & txtUser.Text & "', '" & txtPwd.Text & "')" Looks like you missed the single quote before the first value. …

Member Avatar for SQLpower
0
272
Member Avatar for Jawow

Read the error message. You have to declare the variables and objects with types. Without seeing the form (and properties) I can only assume you created text boxes but left them with the default names (like TextBox1) instead of renaming them (like txtTown). Also, for loop variables you can declare …

Member Avatar for Reverend Jim
0
845
Member Avatar for tieties

Name your fields explicitly. If your table has more columns than specified values the insert will fail. The format is INSERT INTO table (fldname1,fldname2,etc) VALUES('value1','value2',etc) Keeping in mind that you don't need the single quotes around numeric fields. Also, by explicitly naming your fields you make the insert independent of …

Member Avatar for Reverend Jim
0
283
Member Avatar for tooGr8
Member Avatar for happygeek

They say "don't ask the barber if you need a haircut". I think this applies here as the survey was done by an organization that definitely has something to gain by FUDding. In all the years I have been online (at work and at home) I have only (maybe) been …

Member Avatar for sbesch
0
325
Member Avatar for poojavb

I don't know how you are going to manage a progress bar because the RESTORE command, even if running in a background thread, will not report back the progress of the operation. It will just halt the execution of the thread until it completes. The best you'll do is display …

Member Avatar for Reverend Jim
0
293
Member Avatar for Neethaa

Do a query to select the record with that ID. If it returns a record then you know that it exists. Dim myID As String = "123" query = "SELECT * FROM myTable WHERE company_ID = '" & myID & "'" or even query = "SELECT COUNT(*) FROM myTable WHERE …

Member Avatar for Neethaa
0
125
Member Avatar for Reverend Jim

If I go to a forum (VB.Net in this case) I see a number of threads marked as NEW. I select one thread somewhat down the list and open it. I respond to the question, then redisplay the VB.Net threads. All of the NEW flags have now been removed. Is …

Member Avatar for blud
0
263
Member Avatar for ohwhatacuteanaconda

@anaconda Your If block will not work as you expect because you are comparing strings (txtMonth.Text) to integers. A date picker is a better method for date selection.

Member Avatar for Reverend Jim
0
176
Member Avatar for pratik65
Member Avatar for Robert_3

I have heard good things about [PC Decrappifier](http://www.pcdecrapifier.com/). It's free for personal use.

Member Avatar for CimmerianX
0
188
Member Avatar for savedlema

What database are you using? MS SQL uses the COALESCE(field,value if NULL) function while MS Access uses NZ(field,value if NULL) function.

Member Avatar for savedlema
0
6K
Member Avatar for Matigo

That will tell you whether the machine is on the network but does not tell you if the server is up. Of course, "up" is open to interpretation. If you are running multiple services (FTP, WEB, etc) what can be non-responsive before it is considered not to be up?

Member Avatar for Matigo
0
5K
Member Avatar for LucianAdamson

When I run the following code Private Sub Button_Click(sender As System.Object, e As System.EventArgs) Handles btnCol1.Click For i = 1 To 100 ComboBox1.Items.Add(i) Next End Sub Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click ComboBox1.Items.Clear() For i = 1001 To 1010 ComboBox1.Items.Add(i) Next End Sub I get what …

Member Avatar for LucianAdamson
0
463
Member Avatar for LastMitch

Unfortunately you have one side that has demonstrated it will do anything to win including obstructing government, voter registration fraud, lying and bankrupting the country. Also unfortunately, you have another side that still thinks it is possible to "play nice" with the other side. Maybe if I explain to him …

Member Avatar for tech-ultrasonic
0
290
Member Avatar for 41906934@UNISA

"Password" is a reserved word in SQL. Try mystring = "UPDATE ClientLogIn SET [Password] = '" & PasswordTextBox.Text & "' WHERE ClientID = '" & ClientIDTextBox.Text & "' AND Username = '" & UsernameTextBox.Text & "'"

Member Avatar for 41906934@UNISA
0
151
Member Avatar for syfyguy

A textbox, by definition, contains text. Also keep in mind that "0" is not equal to 0 The first is a string containing one character, the other is an integer. Everything is stored internally as numbers. The number zero has a value of (you guessed it), 0. However the character …

Member Avatar for Reverend Jim
0
157
Member Avatar for samsonmitu

You haven't created the objects. The statement Dim cn As OleDb.OleDbConnection says "allocate a variable named cn that can be used to access an OleDbConnection object. That statement doesn't actually create the object (it isn't pointing at anything). You need to use Dim cn As New OleDb.OleDbConnection This creates the …

Member Avatar for Reverend Jim
0
218
Member Avatar for jemz

Here's an example using the Microsoft PUBS sample database. ListView1.Items.Clear() Dim con As New SqlConnection("Server=.\SQLEXPRESS;Database=PUBS;Trusted_Connection=yes;") Dim cmd As New SqlCommand con.Open() cmd.Connection = con cmd.CommandText = "SELECT au_lname,au_fname,zip FROM authors" Dim rdr As SqlDataReader = cmd.ExecuteReader If rdr.HasRows Then Do While rdr.Read() Dim item As New ListViewItem item.Text = rdr("au_lname") …

Member Avatar for Reverend Jim
0
1K
Member Avatar for jemz

If you go into design view, right click on the listview and select "Edit Columns" you will see the names of all the columns (you can change these names). You can use these names to modify the header text at runtime as in ColumnHeader1.Text = "new header text" If you …

Member Avatar for jemz
0
1K
Member Avatar for Reverend Jim

Has anyone looked at why I can't attach files to posts using FireFox? I'm currently on FireFox 16.0.2 but I had the same problem with previous versions.

Member Avatar for Dani
0
519
Member Avatar for 404notfound

The trick is to ensure that a NULL is not returned when you query the table. This can be accomplished using the NZ function. For example SELECT lastName,middleName,firstName FROM mytable might return a NULL for middleName when there is no entry for that field, however SELECT lastName,NZ(middleName,""),firstName FROM mytable will …

Member Avatar for 404notfound
0
145
Member Avatar for Matigo

I wrote something similar while troubleshooting a wireless internet connection this summer. You are welcoome to have a look if it will help. You'll find it [here]( http://static.daniweb.com/images/attachments/3/2012-11-03_10-33_InternetMonitor.zip). It uses three background threads to monitor * The wireless hub (192.168.1.1) * two DNS although you can enter up to three …

Member Avatar for Matigo
0
129
Member Avatar for indrajeet6

First suggestion is to declare the parameter types in AddUserFun as Function AddUserFun(user As String, pass As String, acclvl As Integer) As Integer and at the top of this function you can add (for now) Debug.WriteLine("ADD user=" & user & " pass=" & pass & " acclvl=" & acclvl.ToString()) If …

Member Avatar for indrajeet6
0
179
Member Avatar for LucianAdamson

Here is a sample of traversing a simple xml structure Dim myxml = <root> <level id="1"> <prop n="PROPERTY" v="VALUE"/> </level> <level id="2"> <prop n="PROPERTY" v="VALUE"/> </level> </root> For Each level In myxml.Elements Debug.WriteLine("id=" & level.@id.ToString) For Each prop In level.Elements Debug.WriteLine("n=" & prop.@n.ToString & " v=" & prop.@v.ToString) Next Next

Member Avatar for LucianAdamson
0
295
Member Avatar for joshl_1995
Member Avatar for happygeek

The problem is that Microsoft unilaterally decided how you were going to use Windows 8. Metro is clearly designed for tablets with touch screens but just try using a touch screen on a desktop for productivity type work. Tired arms and smudges. They could have given the user the option …

Member Avatar for Ancient Dragon
1
473
Member Avatar for BigPaw

My older son is currently living in Stony Brook, Long Island. His house was on a hill (60 feet above sea level) and survived intact. However, he spent the duration of the storm in his office at the University (which also survived intact - 40 feet abouve sea level). He …

Member Avatar for GrimJack
0
103
Member Avatar for keyontes

Once you have eliminated and flagged bad input values, the setting of the rate is simple when you realize that you have several cases. The first case is weight <= 2 kg, the second is weight <= 6, etc. That translates nicely into a select case structure. As long as …

Member Avatar for Icone
0
188
Member Avatar for babbu

>There's a piece of code that disables all texts including special characters, it allows number only. I've been using it. That's of absolutely no help unless you are willing to post the code or a link to it. Also, to everyone who has posted here in the last few days …

Member Avatar for Reverend Jim
0
3K
Member Avatar for akasekaihime

What are you having a problem with? Is it selecting the data from the database or is it displaying the data?

Member Avatar for Icone
0
147
Member Avatar for jhedonghae

It depends on what database engine you are using. For example, in Access you would do (depending on your system's short-date format) SELECT * FROM myTable WHERE thedate >= #2012-03-07# AND thedate <= #2012-09-15# but in MS SQL you could do SELECT * FROM myTable WHERE thedate BETWEEN '2012-03-07' AND …

Member Avatar for Icone
0
167
Member Avatar for revathi.sampath.90

The above response merely displays the current date and time. To calculate the difference between two date/time values you do the following: txtTimeWorked.Text = DateDiff(DateInterval.Minute, CDate(txtTimeIn.Text), CDate(txtTimeOut.Text)) Assuming that the two fields used in the calculation both contain valid date/time values, it returns the elapsed time in minutes (in the …

Member Avatar for Icone
0
124
Member Avatar for shriram.pendse

I wrote an app to monitor a troublesome internet connection. It uses three background threads to monitor three points. I've attached it to this thread and I'd be happy to answer any questions. It's not too complicated and I believe it illustrates some of the things you are trying to …

Member Avatar for Reverend Jim
0
112
Member Avatar for Matigo

I attached a sample project that implements a command shell inside a Windows form. I hope this helps.

Member Avatar for Reverend Jim
0
467

The End.