4,901 Posted Topics
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] … | |
| |
Re: [QUOTE]I wrote a code that stores three names[QUOTE} Your code actually stores 4 names. [QUOTE] - Make the user select a number (from 1-3) by using a (combobox) - If the user select the proper number then a message will appear that the name is there. [/QUOTE] How do you … | |
Re: If pressed, I would say number 4. Counters are incremented by fixed amounts. The increment in number 4 varies depending on the current value of counter. Technically, number 4 could be a counter if (for example) in a loop, the number of things you are counting doubles each time. Then … | |
Re: I would create an array of denominations ordered from largest to smallest. Then I would create a while loop that runs while the balance (cash - cost) is greater than zero. An inner loop would select denominations from largest to smallest and determine how many multiples of each could be … | |
Re: I don't know if COALESCE is available under Access (but it is under SQL). It takes a variable number of arguments and returns the first value that is non NULL. If you call it like COALESCE(MAX(Column),0) it may give you what you want (again, assuming it is supported under Access). | |
Could somebody please put a sticky post like [URL="http://www.daniweb.com/software-development/python/threads/366794"]this[/URL] at the top of the VB.NET forum? It's gotten to the point where people are now posting blocks of uncommented code and no actual question. It might help if the first thing at the top of the page was [B][COLOR="Red"]"Read This … | |
Re: As a rule it is considered prudent to provide more than just a block of uncommented code and no actual explanation or question. What is the code supposed to do? How does this differ from what the code actually does? Are you getting any errors? What does your input look … | |
Re: I'm not sure what you mean by validate the file size. You can get the file size by [code] My.Computer.FileSystem.GetFileInfo(filename).Length [/code] Typically you would validate it by uploading it then comparing the size of the uploaded file to the size of the local file but you say you want to … | |
Re: You could use an Access database or an Excel spreadsheet. There are connection strings available for both of these. Even CSV files as I recall. | |
Re: The process I would use is as follows: [code] create an Excel application object create a workbook select the first worksheet set row index to first row for each selected csv file set column index to first column for each line in this file for each field in this line … | |
Re: First thing I would check is whether the query string on line 51 actually contains the query to delete the record you want. For example, if b doesn't have the value you expect then the query won't delete what you want. As for why the record is not being deleted … |
The End.