How To Manage Proper Code
Jul 7, 2010
I have data source and table that I can bind to my controls and datagridview. I can add records to data table and i can view on datagridview but I can't update and Delete records using datagrid. I have following code.[code]
View 1 Replies
ADVERTISEMENT
Jan 18, 2012
I had a weird series of errors involving e.Graphics.DrawString() when painting a panel.I am using a barcode font [Code 128] with a library that converts text to the proper format for Barcode readers.That's fine, however, when I draw it to the panel, that's where things stop being fine:But, here's where things get funky. When I put it into a TextBox instead of drawing it via Graphics.DrawString(), everything is peachy:In fact, the TextBox one looks much better than the Graphics.DrawString() one! Am I doing something wrong?[code]
View 2 Replies
Aug 14, 2009
technique for calling VB.NET methods (C# methods as well) from VBA code?
View 2 Replies
Sep 26, 2010
that i can get a message box containing thitems who have the first letter i asked in a textbox , and the items are in a list box. So I repeat, i have alist box, i havetems in it, and i have a text boxupper that i wrote a letter in, and i want that when i click on the button under, it shows me the items in the list boxhat begin with the letter I enteredn the text box
View 1 Replies
May 16, 2010
TextBox1.font.size = "8".Gives me an error.... what would be the proper syntax to define a font size in code.yes I know it can be changed in the properties but I need to know to change it in code too..
View 1 Replies
Mar 17, 2010
So I'm building an application that is going to do a ton of code generation with both C# and VB output (depending on project settings). I've got a CodeTemplateEngine, with two derived classes VBTemplateEngine and CSharpTemplateEngine. This question regards creating the property signatures based on columns in a database table. Using the IDataReader's GetSchemaTable method I gather the CLR type of the column, such as "System.Int32", and whether it IsNullable. However, I'd like to keep the code simple, and instead of having a property that looks like:
[Code]...
View 2 Replies
Oct 3, 2011
I'm just using the default SQL Server Express in my vb 2008 express edition as my database server for my database operation. When I tried to update the records on my table I got a runtime error which indicates the error on this line 'myCommand.ExecuteNonQuery()'and it highlights a yellow background on it. The runtime error says "SqlException was unhandled: An expression of non-boolean type specified in a context where a condition is expected, near 'Number'. ".
Imports System.Data.SqlClient
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim myConnection As New SqlConnection
Dim myCommand As New SqlCommand
[code]....
View 3 Replies
Nov 17, 2011
I have a total of 102 values associated with a fieldname called ArrivedFlag.Then I have a TextBox control with an id of txtFlag on the markup page.In my codebehind, I have an if statement that says:
If txtFlag <> "value1" and txtFlag <> "another value" Then
lblMessage.Text ="You don't have the ability to view details"
end if
This works fine.However, given that there are 102 values, I feel that doing an IF statement 102 times is a bit inefficient.
Dim allowedFlags = New List(Of String)()
With { _
"value1", _
"another value"
[code]....
View 4 Replies
Dec 11, 2011
I was asked by a client to create a tool that would let a user add/modify/delete/read content from a database. The content can be read from TextBoxes.
My question is, what is the best way to manage GUI locks/unlocks for the different states of the program. IE: If I'm in a "insert" mode, some GUI elements should be enabled, and some not. If I'm in the "read-only" mode, a bunch of them should be disabled... etc.
View 1 Replies
Aug 21, 2010
I am writing a program that uses an array with three columns and a varying amount of rows. I need to load info on a list of files in an archive(specifically: file name, size, path), and I am wondering what the most convenient way to store strings(to be loaded into the array) is.
For example: I tried creating a new .resx file in my project, and writing a function to be executed on form1_load that reads the strings from the .resx file and places them in the array in their correct column, but unfortunately had no success.
I really have no idea how resx files work, I can put strings in them using the resource editor, but I don't know how to retrieve them using resourcemanager.
I would just put the info straight into an array, but it's much easier to update a .resx file when the archive changes than it is to update the code.
Could someone please tell me how to use .resx files in vb.net? Or an easier way of accomplishing my goal?
View 7 Replies
Feb 3, 2011
I can't manage to add different values together...
TextBoxAnswer.Text = TextBox1.Text + TextBox2.Text + TextBox3.Text + TextBox4.Text
I import decimal values from my SQL Server into the TextBoxes 1-4, which works fine. But when I try to add the values together into another textbox the answer is just the values combined like a string...?The column of the table in the SQL server has a datatype decimal(18, 2)I have also tried to convert the values in the textboxes into int, str, double... Nothing seems to work...
Example:
Answer = 2,50 + 2,50 + 5,50 + 4,50
So,
TextBoxAnswer.Text = 10,00
but, all I get is:
2,502,505,504,50
View 3 Replies
May 29, 2012
I am now convinced there is no such thing using VB 2010 Express. I have read, re-read, studied, copied and pasted code to no end and all I get are error messages galore. It appears there is a big gap between what's on line as far as tutorials and the code that VB 2010 Express will accept. I hate to sound so lost but at the moment I am. I used to program in BASIC and QBASIC. I was a master at opening up ascii text files, reading them in sequential order, sorting, manipulating, then re-writing them. It was all so easy, like this: [code] That's all I want to learn how to do for the moment. But every tutorial or article I find goes off in to wild tangents about How to Manage Directories or it reads the entire text file into one giant object. Or worse, there's some code which looks promising but it won't run under VB 2010 Express or it might run but the author leaves out important parts of the code that have to be declared ahead of the subroutine....you all know what I mean. It can't be this difficult to just read a text file one line at a time, therefore it shouldn't be so difficult to find an accurate and up to date article on this.This is for really rough programming. I don't need an interface of any kind. The user, will not even need to know that anything is happening. I simply want to read text files, manipulate what's in them and then re-write the edited text.
View 5 Replies
Jun 8, 2011
im using dreamweaver and i have a table in which i have an image. When i add another table under the table existing it comes right at the bottom. What should i do to that table so i can move it and place it anywhere around the page. displaying my data wherever i want. And another problem is that, when i place something on the top it doesnt show up there it comes slighty away from where i had placed.
View 1 Replies
Jul 26, 2009
I want to know that what we use to manage another computer.
View 2 Replies
Dec 15, 2010
Id'like to pass some variables (string and integers) to a class, and when I call a method of that class, it has to change the original variable.I know it was not impossible in C#, but I'm using VB2010, I made a C# project into my solution, but methods using pointers are hidden into VB. How can I make that kind of change?
An example:
Sub ChangeValues()
Dim A As Integer = 1, Str As String = "Start String"
Dim X As MyClass(A, Str)
X.ChangeInt(2)
[code]....
View 11 Replies
Dec 1, 2009
What is the best way for me to have several datasets ?i've thought about creating a routine for creating datasets with a number in their names, each one with the desired data, but that's not very intelligent (although might work)i'd like to create what would be like an "ARRAY OF DATASETS"
[Code]...
(obs, i've done the same code loading one XML to one dataset and it works perfectly, i've gone back and forth more than one time to assure that it isn't just a logical mistake, it's syntax and lack of programming knowlegde.
View 3 Replies
May 4, 2009
How To Manage A Simple Database
View 1 Replies
Feb 27, 2009
What I want my program to do is to make a selection from the ComboBox and it will be added to the ListBox. If the selection is already in the ListBox, a message will appear.
Note: Project / Properties / Option strict is On
This is my codes, but the If-Else doesn't seems to work.
For Each country As String In lstCountry.Items
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbxCountries.SelectedIndexChanged
[code] .....
View 4 Replies
Aug 10, 2011
I'm creating a small program in Visual Basic, using Visual Studio 2010, which communicates with a GSM modem via serial port.The connection works, I can even communicate properly with the modem and I can also send sms and mms .. But I can not handle the modem answers ... I'll explain:If I send a command like AT + CSQ modem replies with + CSQ 22.0. This command gives me the value of the signal as a response on a scale of 0-30 ... I can see on the screen (in a dedicated console) but I would like to manage the response in the sense that I would do something like that
IF (answer.text = "+CSQ 22,0") Then
label1.text = "Good"
ELSE
label1.text = "Bad"
END IF
View 1 Replies
Jan 6, 2012
I have an application that works together with a SQL database. This database has more than 40 tables and my applican has to extract different situations from those tables.
I have predefined some queries for the situations that I know they need to be in the application.
The idea is that I need kind of a module in which an user can create his own situation based on the tables, views, functions and procedures that already exist in the database. Something like it is in SQL. There has to be a library or something which will read my sql database directly from my application and which allow the user to create his own queries and situations.
View 8 Replies
Jul 13, 2010
I am now building a project where I need to regulate the monitor brightness from software using vbnet.I have now put 2 buttons (+ and -) but I cannot adjust brightess monitor from code usinf these buttons!=!=!=!
View 8 Replies
Mar 3, 2011
I am new to using Visual Basic. Normally when designing other projects, CAD for PCBs, C source code, Mechanical parts etc, I maintain a sequence of design files with minor revision name changes such as r1, r2, r3 etc as I develop the design/debug process. This makes it easy to go back a step if the recent changes I've made prove to be a problem and need to be deleted. I am not sure how to do this using Microsoft Visual Basic 2008 Express Edition.
View 5 Replies
Nov 3, 2010
I am reading data from an XML file. This local XML file will be updated by another application, and I will need to periodically re-evaluate the XML file, and only import new data into a list box. Furthermore, I want to be able to click on a particular item in the listbox, and display the other values about that particular XML entry.
So, I suppose this is a multi part question. What is the proper way to import only NEW data into the program, what is the proper way to store the data, and how do I associate a value in a listbox with the data stored elsewhere?
I've considered multidimensional arrays, but have been told that strings to char arrays and then back to strings is a terrible way to manage the data, but was never offered an alternative.
View 2 Replies
Nov 17, 2011
The first thing that I have found difficult to manage is when a program has several forms. Basically what I do is just hiding one and showing up the other form. it does not look that nice. I was thinking of having one form and laying all the other forms on that one. Let me explain myself more thoroughly. Let's say to the left hand side of my form, i have few group boxes with buttons. So when clicking a button, it should automatically close the form and show up the new one on the main form. Its like refreshing the form. So what I mean is that there is only one main form and clicking each button will show another form.
View 4 Replies
May 22, 2010
I am making a application to help manage your files and notes on different projects, you can organize your notes, images and videos, However i am stuck on what coding to use to manage the project, what my.settings etc.
View 2 Replies
Nov 18, 2009
Whenever I work with applications involving database I have this habit of declaring a global variable that holds reference to a Connection object and keeps it open throughout the lifetime of the application and closes and disposes it accordingly at program exit.I've been doing this since my VB6 days and still doing it now in dotNET. I've read a lot of articles regarding this practice and most of them states that it has great impact on connection pooling. Does this also mean something when my application connects to a database file (i.e. MS Access, flat text files)? Is it true that the DataAdapter and Command objects open and close the connection?
View 2 Replies
Apr 26, 2011
I am running a ASp.Net mvc app in localhost - dev server given with visual studio. I want to get the IP address. I tried
Request.UserHostAddress
and
Request.ServerVariables("REMOTE_ADDR")
In both cases, I am getting ::1 as the result. What is it? Why am I getting it? How can I get 127.0.0.1 or 192.168.1.xxx?
View 3 Replies
Mar 21, 2010
The problem I am experiencing has to do with using DataGridView.Member to access a BindingList.
My app has a UserControl called MaterialsControl, on it lives a DataGridView name dgvLineItems. Using the designer, I've set the DataSource for dgvLineItems to the MaterialsControl. MaterialsControl also has a "Items" Property. "Items" is a BindingList(Of LineItem). dgvLineItems.Member is set to "Items." The LineItem class implements INotifyPropertyChanged
Presently, when I add anything to Items, the DataGridView does not show any changes.Alternatively, when dgvLineItems.DataSource is set to Items (which to my knowledge can only be done manually), anything added to Items appears in the dgvLineItems.
Just for clarification, the DataGridView I'm using is for output primarily, the user will be able to delete values from the view, but not edit them. Insertion is done through an event handler.
View 11 Replies
Sep 2, 2009
I'm working on some code that was developed by the previous developer of an application and I don't understand why he used a certain syntax for IndexOf().This is the code (MyString is just an example of the string being searched for): [code] I can't seem to find any documentation for this unless it's inside of a loop where the number after the comma is incremented.
View 3 Replies
Mar 5, 2011
I use thrid party activex control/ dll/ocx file. I add them by using choose items and browse the desire file. When i deploy the application is that works?If not where i add these files which are use at any system where i install my application.
View 2 Replies