What I need help with should be simple to alot of you. What I need to do is add text infront of an item that is loaded from a database to a combobox. What I would like to do is put "Invoice Number" infront of "InvoiceNumber", and "Date" infront of "InvoiceDate".Here is my code:
If txtcompany.Text = "" Then
cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:QuickInvoiceDatabaseInvoiceDatabase.mdb;")
cmd = New OleDbCommand("SELECT * FROM Table1 Where Cname='" & txtname.Text & "'", cn)
cn.Open()
Is it possible to define my list of strings like in 'good old' VB60, to use only on ebyte of memory for each character? .NET always seems to store any string as unicode, which doubles the required memory. The case is that I have a huge list of strings, all of the same size. It is about 50.000.000 items, 12 characters each. You can imagine I am running out of memory in no time. I tried converting them to arrays-of-bytes but in that case I loose the possibility to perform a "LIKE" statement in a FOR-EACH loop to check for a specific item.
I have a datalist that returns multiple entries and I need to insert values via an OnClick command for a button I have with each entry. Problem is it's saying that a label I have in the datalist is not declared, in particular the MyLabel.Text from my Insert statement below.Can someone show me with code how I can declare this label or is it even possible? When I put the label outside of the datalist, everything works fine but when it's inside it says it's not declared. [code]...
i have a combobox containing countries name and their codes like INDIA:CNT001 then i have a textbox that store the code of country i.e CNT001(fetching from database) Now i want to match that code with the combobox code so that the combobox is set to that item when i click a button. i m using vb.net and sql server as database.
i'm doing a desktop application using VS2005 with MSSQL 2005. i have a problem with the where clause in the update statement while selecting the listbox item. this is the code for the listbox in load page:
[Code]....
and this is my update query in the delete button event handler: mySQL = "update Appointment set recordStatus = 'deleted'" how do i put in the where clause in when i have 4 columns in the listbox? so can i do this with listbox or have to do with datagridview?
the below statment is right 100% but what i need is to change the word mobinil when the user choose another item from the combobox
cmd.CommandText = "select * from warehouse where mobinil ='" + ComboBox2.Text + "'".I thought that i can do the follwoing dim x as string x= here will be the item selected by user- and ofcourse i need it to be put instead of the word Mobinil cmd.CommandText =
"select * from warehouse where x value ='" + ComboBox2.Text + "'" is that possible ?
Regarding my college project. i'm working on a sales system . i have a form which consist of all the following information( item code , item name , item price , quantity of item ) which is display using a data grid . data input by user using text box and all this information will be stored in a database(sales database) i'm using ms access 2007. the grand total will be displayed in a text box . and amount paid will be input in a text box too , my major problem now is how to i create a reciept that will have all this information of the purcase. i have a reciept button . what the next step ? i dont have any idea how to get the reciept done.
I'm trying to declare an enumeration and one of the names I'd like to use for an item is not usable apparently. Where I am declaring 'STEP = 3', I get this error message in visual studio: "Statement cannot appear within an Enum body. End of statement expected." Is it possible to use STEP as an item name somehow? [Code]
I have a datagridview which is populated with information from a database. I would like it so that when I click on one of the items in the table, the information appears in the text box, or other suitable tool.
The VB output is an EPG (electronic program guide), that has a list of programs and the channels/time etc. So when you click on the program such as 'The News,' the data from the database such as 'Description' will appear in the textbox.
Now it is really hard to find manually all those statement which starts with "copy ".I would like to create another new text file with all those statements which starts with "Copy".
I'm creating a report with crystal reports where I show some fields from 2 tables.The worst thing is that I don't know how to insert an sql statement inside of a textbox. For example, wanna insert the total quantity of items of an order, (tables: items, orders).
With an SQL query is very easy to take the quantity of items, but don't know how to put the quantity in a text field inside the report designer, and there are no sql queries options in the reporter to do.
I have a list box on the form which functions as a copy/paste. When you copy something, it is automatically added to the list box as a "clipboard helper". Here is the problem,however: if the text is more than 1 line, the list box does not show all the text.It ends up looking messy.So getting back to my question, is it possible to make the list box item height for an item depending on the amount of lines that item contains?This is a one line sentence in the list box and should take up one line.This is a multi line sentence in the list box and should take up two lines for item height.
well i am not that good at the programming i was about to make a small program that allow me to change a character to another , like if the whole text contains the litter "a" in some places i would like to change it to other character in the same places they are, but instead of having it in the same text box , the program transfer it to a label with the changes i maid
What is the best way to run an if statement if I have text in my textboxes?I have 6 textboxes,textbox1 will always have text but how would I do this?[code]
In my application I have a listbox and SelectionMode should be MultiSimple because users need to see which items they selected. In another tab we have another listbox this one should show all the selection users had done in first tab. Private Sub
i have a class where are code the methode that i have to use in my form. i want to display on a button with a if statement a text value depending of the requirement are met. i put the code of the class here:
I'm running some if statement but I have hit a brick wall with what I'm doing and trying to do. If textbox1 has a value then I run different coding to if textbox1 and textbox2 have a value - Textbox1 will always have a value. [Code] What I'm trying to do is add an additional statement if both Textbox1 and Textbox2 have text, then to run code 1 if the last four characters in textbox2 ends in .jpg else to run code 2. [Code]
Just wondering if anyone knows how I can get an item text from a listbox while in another thread, when I try listbox1.items.item(1) I dont get the usual list but Gethashcode etc
I am building a small utility to transfer files. I have a list box that I am adding the file names to be moved. The question is how to I add a text and a value field to a list box item. This will not be databound it is an unbound list box. I am using this to add the filename but I want the value to have the full path for later file moving. So how do I add a value and a text to an item?
Im trying to come up with a do while statement that reads through a text file till the end while pulling out 3 different matched items, then writing those matched items to ascending spots in an excel file, and then creating a bar graph according to the saved data. Sounds complicated but...I have the program reading the text file, pulling out the first iteration of all three, writing them to an excel file, and I have it even graphing them the way I want it to. The only thing I havent done before (and which is probably the easiest), is creating the do while statement so it keeps searching line to line for the three interactions of what im looking for and writing them to ascending spots in the excel file.
Right now my code works like this, which is perfect for pulling out the first 3 and creating a graph, I just inserting a do while and a rowindex + 1 variable.
vb Dim alines() = System.IO.File.ReadAllLines("C:deviceinfo.txt") Dim amatch As String Dim muvalue As String
[CODE]................
I have a feeling in order to pull this off, I do not want to use the, "ReadAllLines" option and possibly want to put the text into an array.
And do something like: if lines.count > 0
But im not familiar with how arrays work in VB, and more specifically what the syntax is. The other tricky thing I am trying to add is an if statement that adds to a variable (such as i) everytime a line is added to excel so the program will write to ascending lines. I was trying to have the it work with the do while statement but pretty soon realized that if I did: i = i +1. Everytime it went through the loop then the data was going to be on random lines corresponding to their place in the text.
I cannot figure out how to add an item to a listbox with a specific value. I am able to add a text description without any problems, but how can I give it a specific value?
I have a listview setup to act as my main GUI. Kind of like a copy of windows explorer. I'm trying to get it to open individual forms on the double click of each individual icon.
Here is what I have so far to display the text of each item in the listview. I'm not sure how to get it to do what I need though.
Private Sub MainListView_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles MainListView.DoubleClick Dim objDrawingPoint As Drawing.Point