4,901 Posted Topics

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
126
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
842
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
292
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
175
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
150
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
156
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
294
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
472
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
Member Avatar for aerandir.miriel

Your try/Catch is masking the actual error. Use Catch ex As Exception MsgBox(ex.Message) and post the error message here. If you use Debug.WriteLine(ex.Message) then you can just copy/paste the text

Member Avatar for Reverend Jim
0
268
Member Avatar for crazyman6699

Obviously all of your files aren't gone or your system wouldn't be running. How is your system partitioned? Where were the files that you can no longer find? Have you run the disk management console (diskmgmt.msc) to see what the disk info is? What version of Windows are you running? …

Member Avatar for faroukmuhammad
0
113
Member Avatar for kenomote

You could put the due date in one column then calculate the DATEDIFF in days from today. Multiply that by the fine per day. If the result is negative or zero then the book is not overdue and the fine is zero. fine = finerate * Math.Max(0.0, DateDiff(DateInterval.Day, duedate, Now)) …

Member Avatar for kenomote
0
454
Member Avatar for priyanka9
Member Avatar for muhammad.ibraheem

In the line cmd.CommandText = "INSERT INTO table([Name], [Comment], [emailaddress]) VALUES([txtname], [txtcomment], [txtemail])" you haven't supplied any values for the fields. The actual query needs data as in cmd.CommandText = "INSERT INTO table([Name], [Comment], [emailaddress]) " & VALUES('Fred','some guy','fred@hotmail.com')" or cmd.CommandText = "INSERT INTO table([Name], [Comment], [emailaddress]) VALUES(" & "'" …

Member Avatar for muhammad.ibraheem
0
277
Member Avatar for Ancient Dragon

For under five dollars you can buy a program from [Stardock](http://www.stardock.com/products/start8/) called start8. It can be used to restore the start button and make the Windows desktop the default environment. You can also disable some other annoying Windows 8 features. You can try it for 30 days free. I'm currently …

Member Avatar for chris.stout
0
198
Member Avatar for hdeo1235

Use InputBox to enter the names as in Private Sub btnAddNames_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddNames.Click For i As Integer = 0 to 9 names(i) = InputBox("Enter Name") Next End Sub Of course, you'd want to pretty it up a little by checking for blank names, …

Member Avatar for Reverend Jim
0
284
Member Avatar for karthik82vk
Member Avatar for Reverend Jim
0
244
Member Avatar for BigPaw
Member Avatar for deceptikon
0
199
Member Avatar for SaaDwTk

If you combine this with your [other thread](http://www.daniweb.com/software-development/vbnet/threads/438760/cmd-command-error) then you could just run unzip.exe in the spawned shell.

Member Avatar for Reverend Jim
0
120

The End.