Search Results

Search found 4472 results on 179 pages for 'vb'.

Page 26/179 | < Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >

  • Adding data in multiple tables in vb.net

    - by user225269
    This is a winform and I'm using mysql as a database, here is my code: I'm trying to add data into multiple tables. If TextBox14.Text = "" Or TextBox7.Text = "" Or TextBox10.Text = "" Then MsgBox("Please fill up the fields with a labels in bold letters!", MsgBoxStyle.Information) cn = New MySqlConnection("Server=localhost; Database=school;Uid=root;Pwd=nitoryolai123$%^;") 'provider to be used when working with access database cn.Open() cmd = New MySqlCommand("select * from parents, mother, father", cn) cmd.CommandText = "insert into parents values('" + idnum + "','" + p_contact + "','" + p_ad + "')" cmd.CommandText = "insert into mother values('" + idnum + "','" + mother + "','" + mother_occu + "')" cmd.CommandText = "insert into father values('" + idnum + "','" + father + "',''" + father_occu + "')" cmd.ExecuteNonQuery() I get this error, please help: Index and length must refer to a location within the string. Parameter name: length

    Read the article

  • how to combine combo box contents in vb.net

    - by user225269
    I have this, birthday selection which is in 3 combobox, 1 for month, 1 for day and 1 for year. But my database table has only this birthday attribute(no year, month or day). How can I combine the items that are selected in those 3 combo boxes so that they would be fitting in the birthday column?

    Read the article

  • Adding controls dynamically at design time vb.net

    - by chris
    I have been developing some custom smart tags. I am using a DesignerActionMethodItem which gets me to a fired method in code. When I try to hit the controls.Add the control is added but it seems the designer is unaware of it. It is never serialized and it goes away when the form is refreshed in the designer. Any help would be greatly appreciated. I am sort of stuck and google hasn't helped me. Please don't send me anything about smart tags that has nothing to do with adding controls dynamically at design time, I have already read so many looking for this.

    Read the article

  • Passing Byte (VB.NET)

    - by yae
    Hi I need to pass encoded string to php page. To convert string to iso: Dim result As Byte() = Encoding.Convert(Encoding.UTF8, Encoding.GetEncoding("iso-8859-1"), input) I have this code to pass string, but how I must do it to pass Byte (variable result) instead of the string (variable MyVarString)? Dim client As WebClient Dim data As Stream Dim reader As StreamReader Dim baseurl As String baseurl = "http://example.com/api/mypage2.php" client = New WebClient client.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)") client.QueryString.Add("mensaje", MyVarString) data = client.OpenRead(baseurl) reader = New StreamReader(data) s = reader.ReadToEnd() data.Close() reader.Close() Etc.

    Read the article

  • multi-threaded proxy checker having problems

    - by Paul
    hello everyone, I am trying to create a proxy checker. This is my first attempt at multithreading and it's not going so well, the threads seem to be waiting for one to complete before initializing the next. Imports System.Net Imports System.IO Imports System.Threading Public Class Form1 Public sFileName As String Public srFileReader As System.IO.StreamReader Public sInputLine As String Public Class WebCall Public proxy As String Public htmlout As String Public Sub New(ByVal proxy As String) Me.proxy = proxy End Sub Public Event ThreadComplete(ByVal htmlout As String) Public Sub send() Dim myWebRequest As HttpWebRequest = CType(WebRequest.Create("http://www.myserver.com/ip.php"), HttpWebRequest) myWebRequest.Proxy = New WebProxy(proxy, False) Try Dim myWebResponse As HttpWebResponse = CType(myWebRequest.GetResponse(), HttpWebResponse) Dim loResponseStream As StreamReader = New StreamReader(myWebResponse.GetResponseStream()) htmlout = loResponseStream.ReadToEnd() Debug.WriteLine("Finished - " & htmlout) RaiseEvent ThreadComplete(htmlout) Catch ex As WebException If (ex.Status = WebExceptionStatus.ConnectFailure) Then End If Debug.WriteLine("Failed - " & proxy) End Try End Sub End Class Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim proxy As String Dim webArray As New ArrayList() Dim n As Integer For n = 0 To 2 proxy = srFileReader.ReadLine() webArray.Add(New WebCall(proxy)) Next Dim w As WebCall For Each w In webArray Threading.ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf w.send), w) Next w End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load srFileReader = System.IO.File.OpenText("proxies.txt") End Sub End Class

    Read the article

  • How to download .exe file with progress bar - VB 2012

    - by user2839828
    I am trying to create an updater for my program which automatically download's the latest version of my program from the web. Now I want this process to be done using a progress bar (so when the download progress is at 50% the progress bar is half-way through). This is my code: Private Sub client_ProgressChanged(ByVal sender As Object, ByVal e As DownloadProgressChangedEventArgs) Dim bytesIn As Double = Double.Parse(e.BytesReceived.ToString()) Dim totalBytes As Double = Double.Parse(e.TotalBytesToReceive.ToString()) Dim percentage As Double = bytesIn / totalBytes * 100 client.Value = Int32.Parse(Math.Truncate(percentage).ToString()) End Sub Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim url As String = "MY DOWNLOAD LINK" 'Download Dim client As WebClient = New WebClient AddHandler client.DownloadProgressChanged, AddressOf client_ProgressChanged AddHandler client.DownloadFileCompleted, AddressOf client_DownloadCompleted client.DownloadFileAsync(New Uri(url), "C:\Users\User\Desktop\BACKUP\TESTING\New folder\1.exe") End Sub End Class Now I know that the place where the file is saved has been inputed manually by me , but I will change that later. My problem currently is that the file is not being downloaded. However when I change the DownloadFileAsync method to DownloadFile , my program downloads the file. However with the DownloadFile method I will not be able to use the progress bar to track the download progress. Any help is much appreciated :-)

    Read the article

  • C#/VB.Net Web Browser Control Replacement

    - by Lienau
    I've been working on a project that requires that I can go around webpages with different proxies, user-agents, and clear cookies. Now after looking all around the net, it looks like there are some solutions for each of these, but I can never get them working. I was wondering if there was a wrapper for this control that fixed all of these problems or even just a different control I could include. Thanks. Edit: I tried using HTTPWebRequest, it has everything I need -Javascript

    Read the article

  • vb.net array for slideshow button

    - by StealthRT
    Hey all, i am in the middle of trying to figure out how to go about doing this... I have a form that i call like so: call frmSlideShow.showWhat(1,4,8,9,11,22) Each of the numbers represents a different image slide (slide1.png, slide4.png, etc..). The problem i am having is trying to create a "previous" and "next" button to flip through them all. Trying to figure out what number the user is on and going from there and seeing what numbers are still left from the list above that was sent, etc. If anyone has an idea how i would go about doing that then that would be awesome! :) David

    Read the article

  • Webbrowser like Mozilla control for VB.NET question

    - by m.qayyum
    I want to use mozilla control in my application.. But when i use Webbrowsercontrol i just use webbrowser.navigate("http://www.google.com") but this commant is not working with mozilla control ant when we try to navigate to any web address it gives following exception. Exception has been thrown by the target of an invocation.

    Read the article

  • VB.NET Dock problem

    - by Sid
    Whenever I am adding New TableLayoutPanel programmatically in a Panel by setting DockStyle.Top, the last added TableLayoutPanel goes at the top most position of the Panel and the TableLayoutPanel added first comes down. Example: If I add like 1 2 3 4 5 It adds as 5 4 3 2 1 Please help me to fix the problem. The TableLayoutPanels should maintain the order as I am adding. Thanx.

    Read the article

  • Perform a function at a specific time in VB.NET

    - by Shardul
    Hi, I am writing a small app to automatically connect my PC to the internet at a certain time.. I am using rasdial.exe for it... Private Sub SetIt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim windir As String = Environment.GetEnvironmentVariable("WINDIR") Shell(windir & "\system32\rasdial.exe", AppWinStyle.NormalNoFocus) End Sub My question is how to make the shell function run at a specified time or after a certain interval?? Regards, Shardul

    Read the article

  • Memory leak with WPF & ItemsControl (VB.NET)

    - by Matt H.
    I have an ItemsControl that uses a DataTemplate to display properties in my customClass that implements INotifyPropertyChanged... Pretty straightforward... Some items in the DataTemplate use CommandBindings (such as buttons), and a few have some code-behind (yuck). When I empty the ItemsControl and set all instances of customClass = Nothing , no memory is released from my program. This becomes a problem pretty quickly! Any idea where I should start looking? I've even gone so far as to completely traverse the visual tree of each DataTemplate instance and set each Visual = Nothing. I'm not really if that's supposed to have any effect though.

    Read the article

  • Date format error in vb.net ?

    - by ahmed
    I get this error when I run the application Incorrect syntax near 12, on debugging I found that this error is caused due to the # along with the date. Dim backdate as datetime backdate = DateTime.Now.AddDays(-1) on binding the data to the grid to filter the backdate records this error is caused Incorrect syntax near 12. myqry = " select SRNO,SUBJECT,ID where datesend =" backdate Now i am trying to extract only the date or shall I divide the date into day , month and year with DATEPART and take into a variable or convert the date or what should i do , Please help ???

    Read the article

  • Manipulating / Resizing / Scaling an image in vb.net

    - by Christian Payne
    Imagine I have a rectangle say 400px x 300px. Then let’s say I want to load an image in that. All of this is very easy using Sytem.Drawing.DrawImage. But then I want to leave the left hand side as 300px but change the right hand side to 250 px. I can draw the box using 4 DrawLines but I don’t know how to squash the image into the new shape. I want the right hand side of the shape to be 250, the left size 300 and the top and bottom 400px. I can’t use DrawImage as it expects the left and right sizes to be the same. Is there a way to manipulate the image into the new shape? I've looked at other questions, but they only apply where the left and right hand side is equal. Any thoughts on how to squash an image into a shape which did not have parallel sides? (If it helps, I'm happy to sacrifice image quality to fit the right shape.)

    Read the article

  • jQuery "growl-like" effect in VB.net

    - by StealthRT
    Hey all, i have made a simple form that mimiks the jQuery "GROWL" effect seen here http://www.sandbox.timbenniks.com/projects/jquery-notice/ However, i have ran into a problem. If i have more than one call to the form to display a "Growl" then it just refreshes the same form with whatever call i send it. In other words, i can only display one form at a time instead of having one drop down and a new one appear above it. Here is my simple form code for the "GROWL" form: Public Class msgWindow Public howLong As Integer Public theType As String Private loading As Boolean Protected Overrides Sub OnPaint(ByVal pe As System.Windows.Forms.PaintEventArgs) Dim pn As New Pen(Color.DarkGreen) If theType = "OK" Then pn.Color = Color.DarkGreen ElseIf theType = "ERR" Then pn.Color = Color.DarkRed Else pn.Color = Color.DarkOrange End If pn.Width = 2 pe.Graphics.DrawRectangle(pn, 0, 0, Me.Width, Me.Height) pn = Nothing End Sub Public Sub showMessageBox(ByVal typeOfBox As String, ByVal theMessage As String) Me.Opacity = 0 Me.Show() Me.SetDesktopLocation(My.Computer.Screen.WorkingArea.Width - 350, 15) Me.loading = True theType = typeOfBox lblSaying.Text = theMessage If typeOfBox = "OK" Then Me.BackColor = Color.FromArgb(192, 255, 192) ElseIf typeOfBox = "ERR" Then Me.BackColor = Color.FromArgb(255, 192, 192) Else Me.BackColor = Color.FromArgb(255, 255, 192) End If If Len(theMessage) <= 30 Then howLong = 4000 ElseIf Len(theMessage) >= 31 And Len(theMessage) <= 80 Then howLong = 7000 ElseIf Len(theMessage) >= 81 And Len(theMessage) <= 100 Then howLong = 12000 Else howLong = 17000 End If Me.opacityTimer.Start() End Sub Private Sub opacityTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles opacityTimer.Tick If Me.loading Then Me.Opacity += 0.07 If Me.Opacity >= 0.8 Then Me.opacityTimer.Stop() Me.opacityTimer.Dispose() Pause(howLong) Me.loading = False Me.opacityTimer.Start() End If Else Me.Opacity -= 0.08 If Me.Opacity <= 0 Then Me.opacityTimer.Stop() Me.Close() End If End If End Sub Public Sub Pause(ByVal Milliseconds As Integer) Dim dTimer As Date dTimer = Now.AddMilliseconds(Milliseconds) Do While dTimer > Now Application.DoEvents() Loop End Sub End Class I call the form by this simple call: Call msgWindow.showMessageBox("OK", "Finished searching images.") Does anyone know a way where i can have the same setup but would allow me to add any number of forms without refreshing the same form over and over again? Like always, any help would be great! :) David

    Read the article

  • vb.net date format from textbox > MS SQL query

    - by Jonesy
    Hi folks, I have a date column in a DB tabel that I want to query using a date taken from textbox.text. the user selects a date from the calendar in the format dd/MM/yyyy. I want to use that date to put into a query. How do i format the date to be able to query the database? Dim datefrom As String =txtDateFrom.Text Dim dateto As String =txtDateTo.Text The query will look like this: WHERE (tblClient.ClientID = " & ClientID & ") AND (tblBackupArchive.BackupDate BETWEEN '" + datefrom + "' AND '" + dateto + "')" I'm using MS SQL Server btw. Any help most appreciated. Jonesy

    Read the article

  • VB.Net 2008 Chrome or Firefox control

    - by AndyD273
    I'm trying to figure out a way to have multiple sessions at the same website at the same time. I've been using the SHDocVw.InternetExplorer control in Visual Studio 2008 to open a web browser and log in, but at times we need to use a separate login. I haven't found a way to do this using just internet explorer (it just uses the credentials of the first login), so I figure if I can find a similar control for another brower that allows DOM level access then I can just use that. If anyone knows of anything I can try that would be very helpful.

    Read the article

  • Performance Difference between HttpContext user and Thread user

    - by atrueresistance
    I am wondering what the difference between HttpContext.Current.User.Identity.Name.ToString.ToLower and Thread.CurrentPrincipal.Identity.Name.ToString.ToLower. Both methods grab the username in my asp.net 3.5 web service. I decided to figure out if there was any difference in performance using a little program. Running from full Stop to Start Debugging in every run. Dim st As DateTime = DateAndTime.Now Try 'user = HttpContext.Current.User.Identity.Name.ToString.ToLower user = Thread.CurrentPrincipal.Identity.Name.ToString.ToLower Dim dif As TimeSpan = Now.Subtract(st) Dim break As String = "nothing" Catch ex As Exception user = "Undefined" End Try I set a breakpoint on break to read the value of dif. The results were the same for both methods. dif.Milliseconds 0 Integer dif.Ticks 0 Long Using a longer duration, loop 5,000 times results in these figures. Thread Method run 1 dif.Milliseconds 125 Integer dif.Ticks 1250000 Long run 2 dif.Milliseconds 0 Integer dif.Ticks 0 Long run 3 dif.Milliseconds 0 Integer dif.Ticks 0 Long HttpContext Method run 1 dif.Milliseconds 15 Integer dif.Ticks 156250 Long run 2 dif.Milliseconds 156 Integer dif.Ticks 1562500 Long run 3 dif.Milliseconds 0 Integer dif.Ticks 0 Long So I guess what is more prefered, or more compliant with webservice standards? If there is some type of a performance advantage, I can't really tell. Which one scales to larger environments easier?

    Read the article

  • Grouping a generic list via LINQ in VB.NET

    - by CD Smith
    I need to take a collection and group it via Linq but all the examples I've seen fail in some manner or other with some syntax difference that I can't quite lick. My collection: Dim a As New List(Of ProcessAlert) a.Add(New ProcessAlert("0000112367", "[email protected]", "Alert", 2)) a.Add(New ProcessAlert("0000112367", "[email protected]", "Document", 2)) a.Add(New ProcessAlert("0000112367", "[email protected]", "Note", 2)) a.Add(New ProcessAlert("0000112367", "[email protected]", "Alert", 1)) a.Add(New ProcessAlert("0000112367", "[email protected]", "Document", 1)) a.Add(New ProcessAlert("0000112367", "[email protected]", "Note", 1)) Return a I need to turn this collection into a simple way to give this final outcome: "[email protected]", "Alert, Document, Note" "[email protected]", "Alert, Document, Note" Here's the definition of the ProcessAlert class: Public Class ProcessAlert Public LoanNumber As String Public EmailAddress As String Public AlertType As String Public AlertMethodID As Byte End Class Thanks in advance, CD

    Read the article

  • VB.NET - ASP.NET - MS-Access - SQL Statement

    - by Brian
    I have a button which when pressed, sets the user's rights in the db. (If Administrator UserTypeID is set to '2' and if Customer it is set to '1'). However when I run the below code, everything remains the same. I think it's from the SQL statement but I;m not sure. Can anyone help please? Protected Sub btnSetUser_Click(sender As Object, e As System.EventArgs) Handles btnSetUser.Click Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\Brian\Documents\Visual Studio 2010\WebSites\WebSite3\db.mdb;") Dim cmd As OleDbCommand = New OleDbCommand("UPDATE [User] SET [UserTypeID] WHERE Username=?", conn) conn.Open() cmd.Parameters.AddWithValue("@Username", txtUser.Text) If ddUserType.SelectedItem.Text = "Administrator" Then cmd.Parameters.AddWithValue("@UserTypeID", "2") cmd.ExecuteNonQuery() lblSetUser.Text = txtUser.Text + "was set to Administrator." ElseIf ddUserType.SelectedItem.Text = "Customer" Then cmd.Parameters.AddWithValue("@UserTypeID", "1") cmd.ExecuteNonQuery() lblSetUser.Text = txtUser.Text + "was set to Customer." End If conn.Close() End Sub End Class

    Read the article

  • VB.NET Get Publish Revision integer

    - by Berlioz
    How do I get my .NET Winforms app 2.0 to automatically update it's publish revision integer subsequent to issuing the publish command from within VS08. Trying to use the following C# as a guide object[] attrs = System.Reflection.Assembly.GetEntryAssembly().GetCustomAttributes(true); foreach (object o in attrs) if (o.GetType() == typeof(System.Reflection.AssemblyFileVersionAttribute)) label1.Text = ((System.Reflection.AssemblyFileVersionAttribute) o).Version;

    Read the article

< Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >