4,911 Posted Topics

Member Avatar for renzlo

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 …

Member Avatar for renzlo
0
162
Member Avatar for rhone0809

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 …

Member Avatar for M.Waqas Aslam
0
149
Member Avatar for networkmancer
Member Avatar for bettybarnes

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 …

Member Avatar for ChrisPadgham
0
106
Member Avatar for mothra

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.

Member Avatar for mothra
0
817
Member Avatar for donatas
Member Avatar for dilse4sk

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.

Member Avatar for toomutch
0
758
Member Avatar for collin_ola

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.

Member Avatar for collin_ola
0
443
Member Avatar for bigzos

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.

Member Avatar for bigzos
0
148
Member Avatar for toomutch

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 …

Member Avatar for toomutch
0
842
Member Avatar for pipelian

[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.

Member Avatar for pipelian
0
322
Member Avatar for ryklon

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 …

Member Avatar for ryklon
0
1K
Member Avatar for HardWorker2

I need to know the structure of the tables, the relationship between them, and the names of the fields you want to update.

Member Avatar for HardWorker2
0
267
Member Avatar for markdean.expres

You might check out [url]http://glassocean.net/perrys-id3-tag-library/[/url] Available as binary and source

Member Avatar for Reverend Jim
0
241
Member Avatar for Quinncunx

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 …

Member Avatar for jlego
0
240
Member Avatar for aishapot

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]

Member Avatar for aishapot
0
964
Member Avatar for Quinncunx

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, …

Member Avatar for Reverend Jim
0
229
Member Avatar for vivekanandaan

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%' …

Member Avatar for M.Waqas Aslam
0
138
Member Avatar for sushanttade

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 …

Member Avatar for Reverend Jim
0
218
Member Avatar for haqayyum

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

Member Avatar for Reverend Jim
0
2K
Member Avatar for vivekanandaan

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 …

Member Avatar for Reverend Jim
0
161
Member Avatar for rhone0809

I can't open your document. Don't assume everyone has Office 2010. Posting in txt format would be preferable.

Member Avatar for rhone0809
0
456
Member Avatar for Jackwong0099

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 …

Member Avatar for Reverend Jim
0
115
Member Avatar for ng5

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 …

Member Avatar for codeorder
0
435
Member Avatar for razree

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 …

Member Avatar for Reverend Jim
0
238
Member Avatar for dilse4sk

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 …

Member Avatar for Reverend Jim
0
501
Member Avatar for collin_ola

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 …

Member Avatar for collin_ola
0
2K
Member Avatar for artemix22

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 …

Member Avatar for Reverend Jim
0
433
Member Avatar for ryklon

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 …

Member Avatar for Reverend Jim
0
285
Member Avatar for ibeast

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 …

Member Avatar for ibeast
0
1K
Member Avatar for birdlover2010

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)

Member Avatar for codeorder
0
929
Member Avatar for atticusr5

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 …

Member Avatar for Reverend Jim
0
158
Member Avatar for princenathan

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 …

Member Avatar for Reverend Jim
-1
1K
Member Avatar for Reverend Jim

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.

Member Avatar for deceptikon
0
106
Member Avatar for Sevyt
Member Avatar for vammy

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.

Member Avatar for Reverend Jim
0
443
Member Avatar for Rock_IT

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.

Member Avatar for princenathan
0
223
Member Avatar for Kalle21
Member Avatar for gelpena

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 …

Member Avatar for Reverend Jim
0
210
Member Avatar for BlackStar0703

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 …

Member Avatar for Reverend Jim
0
697
Member Avatar for sigridish

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]

Member Avatar for sigridish
0
680
Member Avatar for clow1
Member Avatar for Reverend Jim
0
40
Member Avatar for Computersaurus

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 …

Member Avatar for Reverend Jim
0
324
Member Avatar for sw8revenge

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 …

Member Avatar for Reverend Jim
0
88
Member Avatar for m4_prashanth
Member Avatar for thedonedeal
Member Avatar for jbutardo

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 …

Member Avatar for jbutardo
-1
149
Member Avatar for slbreaul

"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(" ")

Member Avatar for Reverend Jim
0
148
Member Avatar for shibuvarghese

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] …

Member Avatar for Reverend Jim
0
2K
Member Avatar for honeybee2090
Member Avatar for honeybee2090
0
87

The End.