That conversion I don't think will matter. The best thing to do is put a Watch window on the SQL string you are pass in i.e UPDATE * from tblBlah Where Blah=22.55. Copy that and paste it directly into a SQL query and see what errors you get.
John M Bundy
Posts
-
Convert Column from Float to Double Datatype. -
Insert formula into a vairable range of cells in Excel from VBThe below works, you just have to build the string, yours is a common issue. Everything in the formula should be in parenthesis, then go back and replace all numbers with " & D1 & "
osheet.Range("M" & D1).Formula = "=(K" & D1 & ")-(L" & D1 & ")"
-
Insert/Update statementWhat you posted looks ok, but its hard to tell just by that. The only thing i can offer with what you posted is if you are using 64 bit what you have won't work. ACE isn't supported in 64 bit. Post the entire statement or better yet look into TableAdapters.
-
Possibly having to use a web serverI can't really say a lot without knowing more about the program. If you can run it from a memory stick, then you should be able to run it from a CD-RW. It sounds like you have hardcoded paths to the files, and when you put the program on the CD, that is a different address. To answer better we need to know more about the code. For example, show the code where you are opening and working with the .txt files. If you are making changes and writing back to the files, then you can't do that on a CD without a bit of work i would imagine.
-
How to use Transparency key in Splash ScreenThe transparency key likely wont work for your image as the white is made of of several different shades of many colors. You probably would be best to just remove the white background from the jpg.Add an Alpha Channel to your image and clear out the white, if you don't have (or know you have) a program to do this, here are some instructions for doing it in GIMP which is a free editor. http://weisbeek.freewebhostx.com/gimp/[^]
-
ARRAY Standard Deviation vb.netYou are getting the incorrect result because you are trying to get the mean as a running total, and dividing only part of true mean, here is what i mean:
dFAvg = iSum / Convert.ToDouble(lblGrades.Text) 'calculate average
but the way you are calling it in the loop the first time you calculate the mean you are using only one number, then performing your deviation with that. The next loop you have the mean of 2 numbers and use that for your calculations. So what you want to do is load everything and calculate the mean, then use that to loop through and plug into your calculations. The below works:
Dim iSum As Integer = 0
Dim dFAvg As Double = 0
Dim dDev As Double = 0
Dim dSqDev As Double = 0
Dim strArr As Array = {1, 3, 4, 6, 9, 19}For count = 0 To strArr.Length - 1 iSum += Convert.ToDouble(strArr(count))
lstGrades.Items.Add(strArr(count))
lblGrades.Text = lstGrades.Items.Count
lblSum.Text = iSum 'display sum in label box
dFAvg = iSum / Convert.ToDouble(lblGrades.Text) 'calculate average
Next
For count = 0 To strArr.Length - 1
dDev = ((strArr(count) - dFAvg) ^ 2)
dSqDev += dDev
Next 'end for
lblSumDev.Text = FormatNumber(dSqDev, 2)
End Sub -
Set DateTimePicker dateIt depends on what you mean, one month later than what? If you mean one month from another DateTimePicker then
Me.DateTimePicker2.Value = Me.DateTimePicker1.Value.AddMonths(1)
If you mean from todays date then
Me.DateTimePicker1.Value = Me.DateTimePicker1.Value.AddMonths(1)
If that doesn't get you there, please be a little more specific. Thanks
-
vb6 to vb.net help neededI'm not sure where you're headed with what you have, but try here, I downloaded the sample and it worked great. It is in Csharp but that is easy to convert if you need to http://www.eggheadcafe.com/articles/20021019.asp[^]
-
XML Extraction using VBJust because it might be easier for you to work with, take a look at this method. Drag a datagridview onto your form designer and put in the following code, change the table to see your different output. VS is very good at converting between XML and Datasets and vice-versa. If nothing else, the tables will help you visualize the structure of the XML, you can easily see from this sample that size is on a different 'level' than the rest of the data.
Imports System.IO
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'load xml into a dataset to use here
Dim dS As New DataSet
Dim fS As FileStream
'open the xml file so we can use it to fill the dataset
fS = New FileStream("C:\test\10g_2.xml", FileMode.Open)
'fill the dataset
Try
dS.ReadXml(fS)
Catch ex As Exception
MsgBox(ex)
Finally
fS.Close()
End Try
Me.DataGridView1.DataSource = dS.Tables(2)End Sub
End Class
-
Looping Website Viewer?Not sure, never tried but look at this link, has code included. http://www.dreamincode.net/forums/showtopic53244.htm[^]
-
XML Extraction using VBYou are going about it in a kind of roundabout way (i prefer XPath) but I digress, you were on the correct path with your "subnode" line. Following your method, I just add two lines (your original subnode is the same).
Dim subnode = node.SelectSingleNode("Name")
Dim subnode2 = node.SelectSingleNode("SizeData")
Dim SizeData As String = subnode2.Attributes.GetNamedItem("Size").Value -
Looping Website Viewer?Ok so i got the code done quickly :) Add a webbrowser control, a timer, and a button. Set the timer at the interval you want. If you want a stop button, just add one with Me.Timer1.Stop, thats it.
Public Class Form1
Dim siteCount As Integer = 0
Dim aList As New ArrayList
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
aList.Add("http://www.jmbundy.blogspot.com/")
aList.Add("http://www.codeproject.com/Messages/3244826/Re-Looping-Website-Viewer.aspx")
aList.Add("http://www.google.com/webhp?sourceid=navclient&ie=UTF-8")
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.Timer1.Start()
End Sub
Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Me.WebBrowser1.Navigate(Me.aList(siteCount))
If siteCount + 1 <= Me.aList.Count - 1 Then
siteCount += 1
Else : siteCount = 0
End If
End Sub
End Class -
Looping Website Viewer?Have a list of the sites you want to visit in an arraylist, have an integer that will increment from 0 to arraylist.count-1, then put on a timer and set the interval to 45 seconds, then on the timers .tick event navigate to the url stored in arraylist(integer you are incrementing), increment integer. I will try to post some code when i get the chance
-
aaaahhhhhhhhh copy and pasting and reading and writing in txt documentsyou have to close the reader before opening the writer. objReader.Close()