4,911 Posted Topics
Re: The combobox will be populated with the data in column 1. When an item in the combobox is selected, the corresponding value from column 2 will be displayed in the textbox. [code] Private Sub ComboBox1_SelectedValueChanged(sender As System.Object, e As System.EventArgs) Handles ComboBox1.SelectedValueChanged txtExcel.Text = ComboBox1.SelectedValue.ToString End Sub Private Sub btnLoadExcel_Click(sender … | |
Re: You use the CONVERT function. The first parameter is the type you want to convert to (in your case, string), the seconbd parameter is the field to retrieve. The third parameter determines the format. For example select CONVERT(varchar(50),checktime,101) Allowable formats are [code] 100 or 0 mon dd yyyy hh:miAM (or … | |
Re: It would also help if you posted the structure of your table (field names and types) | |
Re: Can you be more specific as to the client's requirements? By POS do you mean "Point Of Sale" or are you referring to a "Piece Of S**t" computer? You won't find a scanner these days that uses the old serial port - just USB. Pretty much all scanners come with … | |
Re: Last question first. ReadAllLines reads the entire file into a stringt array where each element is one line of the file. ReadAllText reads the entire file into one long string. | |
Re: In English, what data are you trying to display? | |
Re: Please refer to the excellent point raised by jbennet [URL="http://www.daniweb.com/software-development/vbnet/threads/411990/1758782#post1758782"]here[/URL] regarding why you want to use substituted parameters. | |
Re: SQL server supports the COALESCE function. I seem to recall that Access has something similar Nz(Value, [ValueIfNull]) I don't have Access installed so I can't verify this. | |
Re: It would really help if you told us what you were missing. By the way, it is not necessary to have "End Select" in every case clause. Only one of the case clauses will ever be executed. | |
Re: I don't know if this is available in MySql but it is a feature of MS SQL (and in a slightly different form, Access). The COALESCE function can be used in a sql query to replace null values with a defailt value. For example select lastName, firstName, COALESCE(title,'n/a') from table1 … | |
Re: [code] Dim prod As String = "P011112" Dim mm As Integer = CInt(prod.Substring(1, 2)) Dim yy As Integer = CInt(prod.Substring(3, 2)) MsgBox(MonthName(mm, False) & ", " & yy + 2003) 'output is "January, 2014" [/code] Assumes that the digits in the string are valid for conversion to date. | |
Re: Try this [code] Private fadeout As Boolean . . . Private Sub btnFadeOut_Click(sender As System.Object, e As System.EventArgs) Handles btnFadeOut.Click fadeout = True Timer3.Enabled = True End Sub Private Sub btnFadeIn_Click(sender As System.Object, e As System.EventArgs) Handles btnFadeIn.Click fadeout = False Timer3.Enabled = True End Sub Private Sub Timer3_Tick(sender As … | |
Re: I need to know the structure of the tables, the relationship between them, and the names of the fields you want to update. | |
Re: You might check out [url]http://glassocean.net/perrys-id3-tag-library/[/url] Available as binary and source | |
Re: When you ask a question like that you are going to get as many different opinions as you have people responding. Everyone has their own style of coding and even that style can evolve. See [URL="http://notinventedhe.re/on/2010-4-20"]Not Invented Here[/URL] for an example. Please keep in mind that the following reflects my … | |
Re: The query syntax to insert a picture into SQL can be found [URL="http://www.daniweb.com/software-development/vbnet/threads/411671/1756549#post1756549"]here[/URL] | |
Re: As I understand it, modules are where you put general purpose code that you may want to reuse in another app. You would not put code in a module if it references forms, variables, controls, etc that exist outside the module unless those references are passed as parameters. For example, … | |
Re: Your statement sql = "insert into mr_detail select job_Code,mr_no,item_code,qty,addl_description" would be complete except you have failed to name the table you are selecting from. For example, if I have two tables containg names, I can do the following insert into table2 (lname,fname) select last_name,first_name from table1 where last_name like 'Jo%' … | |
Re: Try this and see what happens. Copy the following code and save it into a file with the extension "vbs". Replace the username and password values with whatever strings you expect to find in tour admin table. Then run it from the command line like cscript somename.vbs If you are … | |
Re: to add the leading zeroes you can pad the number out by nextid.ToString("0000") once you have maxid. You can generate the next id in the select by select max(ID)+1 as nextid from tblID | |
Re: Let's take two tables with the same structure. Two fields, last_name and first_name where both are varchar(50). To select some data from table 1 and insert it into table 2 you can do insert into Table2 select * from Table1 where last_name = 'Jones' If the tables have similar fields … | |
Re: I can't open your document. Don't assume everyone has Office 2010. Posting in txt format would be preferable. | |
Re: First of all, never use blanks in the name of a field. You should use "Date_of_Birth" rather than "Date of Birth". Secondly, you are retrieving three different fields (chodob1, chodob2 and chodob3) and giving them the same alias (Date Of Birth). Same problem with "Date Of Departure". Fix that and … | |
Re: Go to the project Properties, then click on "Settings" down the left side. Add as many string variables as you have text boxes to save. For example, if you add the string setting, MyText1 you can load the textbox on form load as TextBox1.Text = My.Settings.MyText1 and save the value … | |
Re: First, some pseudo code to get the logic. [code] 'find the most recently modified log file containing a given string mystring = "ERROR" newestfile = "" newestdate = someolddate for each file in the folder if this is a log file if the file contains mystring if this file is … | |
Re: There are a couple of approaches. What I did at work depended on the application(s). If an application needed access to just one database then I would create two accounts in SQL server named APP_RO and APP_RW, where "APP" was replaced with the application name, and RO and RW denoted … | |
Re: One way to do it would be [code] Dim lines() As String = TextBox1.Lines lines(3) = "this is actually line 4" TextBox1.Text = Join(lines, vbCrLf) [/code] Of course, you would get an error if you didn't have enough existing lines. n alternative would be to use a listbox instead and … | |
Re: Can't speak to MYSQL but in SQL Server you insert the file directly as [code] insert into Pictures (name,picture) Values ('first pic',(select * from openrowset(bulk 'd:\temp\testpic.jpg',single_blob) as picture)) [/code] In this case my table is named Pictures and is defined as name=VARCHAR(50) and picture=VARBINARY(MAX) The last parameter in the above … | |
Re: If your source code is available to read, I suspect no. String constants in exe files can be easily extracted so if you want to "hide" the password in the exe then you can build it at run time a character or two at a time, even using conversion from … | |
Re: You could create an array of TextBox references and populate it as you create the controls as in [code] Public Class Form1 Private MyText(3) As TextBox Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load For i As Integer = 0 To 3 Dim box As New TextBox box.Location … | |
Re: use the SelectedItem property of the combobox to get the value. The selected item is available in the event, ComboBox1.SelectedIndexChanged. If you know that the selected item is integer you can convert it as dim mynum as Integer = CInt(combobox1.SelectedItem) | |
Re: Go ahead and post the code. It would also help to see the structure of the table. How you set the value of a local boolean for isAdmin will depend on the field type. For example, if isAdmin is a single character field containing "Y" or "N" (and assuming you … | |
Re: Is this a sample of code that works or is it a piece of code that you are having a problem with? If it is the first then you should explain what it does and how. If it is the second then you should explain what you are trying to … | |
Could someone please undo the negative vote I made on [url]http://www.daniweb.com/software-development/vbnet/threads/411073[/url] I didn't intend to ding the OP and I can't see any way of undoing it myself. | |
Re: Have a look [URL="http://www.connectionstrings.com/"]here[/URL] | |
Re: Try 1000*((6511+500)\1000) With a little playing around you should be able to roll your own Round function to round to an arbitrary digit. | |
Re: You start by reading books. "Wrox Professional Visual Basic" and "Sybex Mastering Visual Basic" both contain very good sections on database programming. Don't expect us to be personal tutors and hold your hand through the learning process. | |
Re: You didn't attach anything that I can see. Can you please explain the problem a little more clearly? [QUOTE]search dates on Sheet1 and copy the name associated with that name[/QUOTE] Are the dates in specific rows and/or columns? What do you mean by "name associated with that name? If you … | |
Re: I wrote something like that quite a while back and I used an 3x3x3x3 array of textboxes. By picking various combinations of indexes I was able to check for duplicates in any of the required directions. If you are interested, there is a very good book by Wei-Meng Lee (Apress … | |
Re: By default when you create a new Excel WorkBook it has three WorkSheets. You can refer to them as [CODE] sheet = xls.ActiveWorkbook.WorkSheet(1) 'or (2) or (3) [/CODE] | |
Re: I use the DivX converter program and VirtualDub(Mod) under Windows 7 | |
Re: Computer stores generally have an image for each flavour of computer and OS. When one of their computers comes back into the shop, all the tech has to do is select the disk that matches that computer/OS and do a restore of the image. All the tech has to do … | |
Re: What do you need help with? At the highest level you have [code] retrieve user info from database display on form [/code] How much detail do you need? What have you done so far? Is your problem defining the database, populating the database, retrieving from the database, writing to another … | |
Re: Just use the SaveWorkspace method with the desired filename. | |
Re: textbox.Text = (timer1.Elapsed + timer2.Elapsed).ToString | |
Re: There are numerous examples in this forum of how to get at data (read and write) in cells in Excel spreadsheets. If you can be bothered to do a search you should be able to find them. That's what the big, obvious Search Box at the top right of this … | |
Re: "Split" takes a string and splits it into multiple strings so the result has to go into a string array as follows dim splitNumbers() as String = txtCompute.Text.Split(" ") | |
Re: You can replace a single quote with two single quotes before you add the string to the query. For example [code] insert into table1 (name) values('D''Costa') [/code] If you need to search for fields that contain characters like '%' and '_' you can use the ESCAPE keyword as follows: [code] … | |
|
The End.