646 Posted Topics
Re: Use Replace and placeholder for table name: [CODE]Dim cmdText2 As String cmdText2 = "SELECT * FROM XTABLEX "[/CODE] and later replace [CODE]cmdText2 = cmdText2.Replace("XTABLEX", strTableName)[/CODE] where strTableName is obtained from the user (or dropdown box) | |
Re: I remember something about SS, haven't used it for a long time. Check first that you did Get/Check Out [U]all[/U] the files. Then take a look at the project in SS. Browse (or search) project's files and check that config files are included to SS project. Finally, if you can't … | |
Re: VBA (or VB.NET) doesn't have any Eval function like you have in JavaScript. I found this article: [URL="http://www.developerfusion.com/code/198/evaluate-string-formulas-in-vb/"]Evaluate string formulas in VB[/URL] which uses Script Control's Eval function. The article's download link is outdated, here's correct link to [URL="http://www.microsoft.com/downloads/en/details.aspx?familyid=D7E31492-2595-49E6-8C02-1426FEC693AC&displaylang=en"]Windows Script Control[/URL]. I didn't test it in anyway, so check it … | |
Re: Here's my old blog post, how to do conversions between byte arrays and image type: [URL="http://windevblog.blogspot.com/2008/08/convert-image-to-byte-array-and-vice.html"]Convert image to byte array and vice versa[/URL]. And here's how you get the image to the picture box: [ICODE]Byte2Image(PictureBox1.Image, ByteArr)[/ICODE] where the ByteArr parameter contains the data from your database. | |
Re: I checked that thread (with zero answers). You had the image of the error message. It said (quite clearly :-/ ): [QUOTE]To replace this default dialog please handle the DataError event.[/QUOTE] How about trapping [B]that[/B] error. You may get the solution from the error message. If not, then let us … | |
Re: What is the error message you get? SQL seems ok to me. %-character is used for pattern matching and it matches any number of characters: sql = "select * from [table] where [field] like 'VB%'" matches [field] starting with "VB" (like "VB6 Language"), sql = "select * from [table] where … | |
Re: [QUOTE]I'm working with a SQLite database, and I want to list every entry inside a listbox (only the "Name" row)[/QUOTE] You do use System.Data.SQLite? Do the binding with ListBox as you do normally but select only "Name" column from the underlying DB. [QUOTE]when you open a window inside a app, … | |
Re: You don't need IIS to send mail from .NET A good starting point is MSDN documentation of [URL="http://msdn.microsoft.com/en-us/library/system.net.mail(v=VS.90).aspx"]System.Net.Mail namespace[/URL]. Here's one [URL="http://msdn.microsoft.com/en-us/library/system.net.mail.mailmessage(v=VS.90).aspx"]example[/URL] from MSDN. Not very good one, but do a bit googling: [URL="http://www.google.com/#hl=en&biw=1664&bih=843&&sa=X&ei=E8EZTaeOMcGa8QPRscCGBw&ved=0CBUQBSgA&q=how+to+send+mail+with+c+sharp&spell=1&fp=ba51afa6d09e5766"]how to send mail with c sharp[/URL] and you'll find examples and tutorials about this subject. You … | |
Re: [QUOTE]replace older version with new version , so all the new featers working such as:[/QUOTE] They will work. If your application version 1.0 is built on (for example) .NET 2.0 and your customer updates the application to version 2.0, which is also built on .NET 2.0, everything works just fine. … | |
Re: You didn't mention where the dates come. From the textboxes or from the datetimepickers. This snippet takes first a date from a picker and then from a textbox [CODE=VB.NET]Dim a As Long a = DateDiff("d", DateTimePicker1.Value.Date, TextBox1.Text)[/CODE] If you use just [ICODE]DateTimePicker1.Value[/ICODE] instead of [ICODE]DateTimePicker1.Value.Date[/ICODE] you get a bit different … | |
Re: I suggest reading [URL="http://msdn.microsoft.com/en-us/library/ms171728%28v=VS.90%29.aspx"]How to: Make Thread-Safe Calls to Windows Forms Controls[/URL] first. It shows you how to access other thread's control in a proper way. HTH | |
Re: And the exact problem is??? Do you have MySQL Workbench? Have you checked the data in the table? Does it look ok i.e. a row gets inserted and updated correctly? What's the declaration for the username, password and salt (long enough fields I mean)? Can you put a breakpoint in … | |
Re: [QUOTE]There is offcourse a global array dimensioned earlier[/QUOTE] Dimensioned in what way? Like [ICODE]Private Resultado_Resta() As String[/ICODE]? That creates an empty array. First, since you don't know beforehand how many elements you insert in to the array, you have to use [ICODE]ReDim Preserve[/ICODE] with that array. Second point (which actually … | |
Re: Since you convert date and time to a string, declare DiTi as string. Also read the ResitTime as it is and after reading value successfully, take hours and minutes [CODE=VB.NET]Dim ResitTime As String = "2011-01-07 15:02:07" ' Debug Dim TempDate As DateTime ' ResitTime as DateTime Dim DiTi As String … | |
Re: I'm not much in to MS Access but you have spaces in table name and field names. The use of "`" character seems odd. Try using "[" and "]" around names: [CODE=C#]this.Project_InformationTableAdapter.InsertCommand.CommandText = "INSERT INTO [Project Info] ([Project Name], [Project Number], Organization, Description)" + " VALUES ('" + this.projectInfoProjectNameTextBox.Text + … | |
Re: [QUOTE]I'm looking for a way to format lines on a MsgBox, so that the records don't seem out of place. If a MsgBox is not the best way, please make a suggestion. [/QUOTE] MessageBox simply displays a string and you can't change the font or other properties of the messabox … | |
![]() | Re: Add [ICODE]Application.DoEvents()[/ICODE] inside the while-loop to yield processing time for processing user events. HTH ![]() |
Re: [QUOTE]You are required to create a suitable database for this task.[/QUOTE] [QUOTE]Cancel all amendments made to the table since the last save[/QUOTE] I would create a duplicate Books table, for example BooksRestore. Every time the user commits changes to information in the details of the book, you insert the original … | |
Re: You didn't mention what DB you're using. Assuming SQL Server you need to make first a full backup (first restore point). After that you can create incremental or differential backups (next restore points). Instead of creating a backup/restore system of your own, use SQL Server's built-in backup/restore functionality which you … | |
Re: Do you try to read from the start of the file: [CODE=C#]FileStream file = File.OpenRead("test.nes"); byte[] storage = new byte[0xffff]; file.Read(storage, 0x0000, 0x8000);[/CODE] | |
Re: So you're trying to read database [B]schema[/B]. OleDbConnection object has a GetSchema method. The code would look something like this [CODE=VB.NET]Dim ConnOleDB As OleDbConnection Dim SchemaDT As DataTable ' Create and init objects. Open DB connection SchemaDT = ConnOleDB.GetSchema("Columns") ' Get all column information [/CODE]Search the web again with words … | |
Re: [QUOTE]Should I perhaps use something other than a list view[/QUOTE] I don't think so. Here's what you asked. Declare dataCountry as a global object so you can access it later. Private Sub InitView() has just settings for the ListView. You can take only settings and make them somewhere else without … | |
Re: Here you go. I added lots of comments so the code should be self explanatory. [CODE=VB.NET]Dim FileName As String = "C:\Temp\test.txt" Dim TextFromTheFile As String ' Whole text Dim Lines() As String ' File splitted to lines Dim LineSeparator() As String = {Environment.NewLine} ' Line separator 'character' ' Use My … | |
Re: [QUOTE]Did you see the constructor, it says (int millisecondTimeout). so it assumes every thing in millisecond. to cancel millisecond effect I multiplied it with 1000. [/QUOTE] And you have an expression "17*1000 / (1000*1000*1000)" which gives 0.000017 i.e. 17 nsec. But, if the constructor takes an integer (int millisecondTimeout), value … | |
Re: [QUOTE]Can anyone help me to tell me why it's occur[/QUOTE] The file is locked and/or you just don't have proper privilege to access that file. [QUOTE]how to solve it...[/QUOTE] You're dealing with SQL Server, right? SQL Server already has built-in backup/restore functionality and you can take advantage of that with … | |
Re: Multiple filters are not supported. Syntax [ICODE]watcher.Filter = "*.txt"[/ICODE] is correct but [ICODE]watcher.Filter = "*.txt|*.ini"[/ICODE] is not. A workaround could be to use two FileSystemWatcher objects, one for *.txt-files and one for *.ini-files, and use the same event handler(s) to handle both objects' events. HTH | |
Re: jlego has it right. Your SQL query returns the correct output which is based on ordering strings. You didn't mention what DB you're using. Here's my quick test with SQL Server 2008: table: ID varchar(50) original data: M 6 M 31 S 28 S 118 SQL query: SELECT * FROM … | |
Re: Sorry, I don't know that game :$ You have an initialization: [CODE=VB.NET]str = TextBox1.Text str2 = str.ToCharArray()[/CODE]What does it do? I mean what's in TextBox1.Text? Line 7: [ICODE]guess = guess1[/ICODE] Why? Line 4: [ICODE]Public Sub checkbulls(ByVal guess1 As String)[/ICODE] What's in the guess1 string? | |
Re: You need a global pointer (array index value) to images [CODE=C#]Image[] images = new Image[40]; private int imageIndex; // Global index that points the current image (index of images array) private void initImages() { // Call initImages() before user can press any button // Load images images[0] = Image.FromFile(@"C:\Users\Administrator\Desktop\PICS\b.JPG"); images[1] … | |
Re: [QUOTE]it will exercise two ways to cause one event handler to handle two (or more) events.[/QUOTE] You need to know which button is pressed? Check the sender object's name property. Here's a WinForms example of (button click) event handler that checks which button is pressed [CODE=C#]private void buttonClick(object sender, EventArgs … | |
Re: [QUOTE]Hint: Use a ReadOnly property on the input form to pass the object to the second form.[/QUOTE] Looks ok to me. But the line above says that you should use a ReadOnly property when [I]passing[/I] the object to form. Not that the properties of the Pet class should be ReadOnly. … | |
Re: You have to use the key as the index for the dictionary. Like this: [CODE=C#]for (int i = 0; i < fooDictionary.Count; ++i) { fooDictionary[fooDictionary.Keys.ElementAt(i)].Update(); }[/CODE] HTH | |
Re: You have to do some googling. I tried [URL="http://www.google.com/search?q="System+Error+%26H80131c25%26""]http://www.google.com/search?q="System+Error+%26H80131c25%26"[/URL] (and few others) but didn't find anything useful. Can you further define the conditions? Were you debugging or was it an executable? Can you repeat the error? Anything additional info could be helpful. Could you use [ICODE]My.Computer.FileSystem.ReadAllText()[/ICODE] (VB.2005 and newer) instead … | |
Re: [QUOTE]but that just got me into all kinds of trouble.[/QUOTE] SendKeys isn't very reliable way to "control" the application, but you could try this: [CODE=C#]f.SelectedPath = dirTextBox; SendKeys.Send("{TAB}{TAB}{RIGHT}");[/CODE] HTH | |
Re: You can disable controls in the other form in this way: [CODE=C#]Form2 oForm; oForm = new Form2(); oForm.Show(); foreach(Control c in oForm.Controls) { c.Enabled=false; }[/CODE] HTH | |
Re: [QUOTE]is there an easier way to do this? [/QUOTE] Yes there is. Use a special naming with textboxes, store strings to an array and pass the array as form's property Here's the code to find those 20 textboxes (named TextBox0, TextBox1,..., TextBox19): [CODE=VB.NET]Dim TextToPass(20) As String ' Array of 20 … | |
Re: [QUOTE]What am I doing wrong? [/QUOTE] Create first an attachment object and after that add it to the attachments [CODE=VB.NET] Dim mail As New MailMessage() 'set the addresses mail.From = New MailAddress("xxx@cox.net") mail.To.Add("xxx@cox.net") 'set the content mail.Subject = "Article to be submitted." Dim MessageText As String = "Here's the article … | |
Re: Here's how you create the folder [CODE=VB.NET]Dim ThisFolder As String Dim LogFolder As String Dim Year As String Dim Month As String Year = DateTime.Now.Year.ToString Month = DateTime.Now.ToString("MMM") If Month.Length > 3 Then Month = Month.Substring(0, 3) End If ThisFolder = Month & Year LogFolder = "C:\LogRoot\" & ThisFolder & … | |
Re: Use MaskedTextBox control: [CODE=VB.NET]MaskedTextBox1.Mask = "00:00"[/CODE] HTH | |
Re: You do things like that with controls' events. In this case with button's MouseEnter and MouseLeave events [CODE=VB.NET]Button1.BackColor = Color.Red Private Sub Button1_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.MouseEnter ' User moves mouse pointer over the button, change the color Button1.BackColor = Color.Yellow End Sub Private Sub … | |
Re: Change asterisk characters to percent characters. Like this: [ICODE]WHERE cont.name like '%mark%' or cont.mobile_num like '%mark%';[/ICODE] HTH | |
Re: [QUOTE]Now I can get a selected file (i.e. from the inbox or folder) to save from the plugin but dont know how to go about saving the email that I just sent.[/QUOTE] The email you sent goes to "Sent Items" folder. I haven't done Outlook plugins, only few macros, but … | |
Re: That kind of conversions are usually made between image formats [B]or[/B] video formats, seldom from images to video. There are plenty of free conversion applications and you'll find them with a little googling. If you find an application that converts a bunch of images to some video file, check if … | |
Re: [QUOTE]Something is obviously wrong with my loop, but I am stumped[/QUOTE] You had: [CODE=VB.NET]' Clear the list box. lstOutput.Items.Clear()[/CODE]inside the loop so the previous result was always "lost". I slightly modified your code by removing Select Case statement [CODE=VB.NET]' Get the 5 store's sales from the user Dim intCount As … | |
Re: Try to dispose previous form instance and create a new one. And use ShowDialog instead of Show. [CODE=VB.NET]Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click Dim frm2 As New Form2() If (frm2.ShowDialog = Windows.Forms.DialogResult.OK) Then UserNameLabel.Text = frm2.UserNameTextBox.Text'which displays the username onto the label' End If … | |
Re: Yes there is. Easiest way is to use [URL="http://dev.mysql.com/downloads/connector/net/5.2.html"]MySQL Connector/Net[/URL]. HTH | |
Re: [QUOTE]I am trying to make an application in vb.net 2008 where in i can open a file from the client computer, do some changes to it and save it back.[/QUOTE] There's no difference between network files and local files in the way you open and modify them. That may be … | |
Re: Have you checked Microsoft's [URL="http://msdn.microsoft.com/en-us/vbasic/bb735936.aspx"]Visual Basic Power Packs 3.0[/URL]? HTH | |
Re: [QUOTE]is there any problem with it ?[/QUOTE] Yes there is. One typo ('form' should be "FROM" and one extra "("-character at the beginning (or one missing ")"-character at the end). Here's corrected version [CODE=VB.NET]com.CommandText = "SELECT [email],[lname] FROM users WHERE [email] = ('" & TextBox1.Text & "') AND [lname] = … | |
Re: [QUOTE]Socket, Problem with socket is that I cannot make more than one connection to a WAN IP[/QUOTE] With two sockets you get two connections. Anyway, with sockets you can make a port scanner. With googling you'll find a plenty of examples. Here's one [URL="http://www.codeproject.com/KB/vb/portscan.aspx"]VB Port Scanner[/URL] in VB but easily … |
The End.