DB/Reporting :: Proper Use Of ADO.NET?

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


ADVERTISEMENT

How To Get Proper IP Address

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

Proper Two Way Binding?

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

Proper Use Of IndexOf

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

Proper Way To Use Activex?

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

Proper Way To Use Resources?

Jun 8, 2010

I'm using VB.Net 2008 .NET 3.0.I am not sure of the proper,or best, way to use Settings and Resources. For now I use the default project wide My.Settings and My.Resources.I have a class that I would like to reuse in other projects, so adding project wide settings or resources in each project doesn't sound proper, nor does creating constants and variables within the class itself.

I'm guessing there is a way to give a class its own resource file, and maybe even settings file, but I'm not sure how to do it. I tried adding a resource file with the same name (but with .resx extension) and I got a weird error saying I was trying to edit a resource that is apart of another project. I continued, but it didn't seem to be what I wanted and I wasn't sure how to access that new resource.I'm not currently concerned with internationalization, but it wouldn't hurt to understand how that would affect what I'm trying to do.

View 6 Replies

Vb 2008 Not Getting In Proper Way?

Feb 13, 2011

why vb 08 help are not getting in proper way. instead getting help for vb 2005 which is not compitable with vb 2008. i m user other vb 8 user must be facing similar problem

View 9 Replies

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

Proper Close A Process?

Aug 10, 2011

I have a process, that when you manually closing it. its closing another processs with him. but when you kill it, the process is still open..

i want to know how to Proper exit a process.

View 11 Replies

Proper Creation Of Usercontrols

May 6, 2010

When we create an inherited control then is the Designer still needed or not? Should usercontrols be disposable?What is the difference of using Base and Me when we are setting default properties of our usercontrols?[code]

View 4 Replies

Proper Formatting For Datagridview?

May 18, 2010

I am fixing up a visual basic program using visual studio 2005, specifically in visual basic. I am currently attempting to format the datagridview used to display data from a database. The values from the database being displayed are a mix of integers (used for displaying information such as number of units sold) and floating point values (used to display revenue, etc). I need to format all the values to display as integers (by simply truncating the decimal places, not rounding) as all (including the values that should already be integers which are appearing with two 0s following the decimal place). I have used the round function as follows round(value, 0, 1) which as I understand should get rid of all decimal places by simply truncating them, however I am still left with two 0s after the decimal place. Next, I went to the designer view and edited the columns property of the datagridview so that they are all set to be numeric with zero decimal places, yet the decimal still remains. I followed that by going back into the code and change any CType() that were decimal to Integer and still no change.

View 5 Replies

Proper Separator For Split?

Jan 20, 2012

i need to comfine 3 string after i need to split it my problem is the 3rd string inside contains ,(Comma) so how to seperate by comma

View 16 Replies

Proper Type Casting?

Jun 18, 2009

Delegate Sub UpdateTextHandler(ByVal recbuffpass() As Integer)

Private Sub someSub()
Dim f As frmMain = My.Application.OpenForms("frmMain")
f.Invoke(New UpdateTextHandler(AddressOf f.UpdateTextMethod), New Object() {recbuf})

[code].....

View 2 Replies

DB/Reporting :: Attach A Dataset To A Table (MS Reporting)?

Jan 9, 2009

I want to do something like this:

Code:
'create a dataset and a table
Dim ds As New DataSet

[code].....

View 5 Replies

.net - Proper Structure Of AJAX Handler?

Jun 1, 2011

My .NET project handles AJAX requests. There are no UI controls at all, it simply responds with text to every AJAX post.

This is my current structure:
<%
SynchLock DBNull.Value
Main
End SynchLock

[Code]...

View 2 Replies

.net - The Proper Way To Dispose Excel Com Object?

Apr 25, 2012

I have following code (obtained from online tutorial). The code is working but I suspect the way to dispose the Excel com object is somewhat not proper. Do we need really need to call GC.Collect? Or what is the best way to dispose this Excel com object?

Public Sub t1()
Dim oExcel As New Excel.Application
Dim oBook As Excel.Workbook = oExcel.Workbooks.Open(TextBox2.Text)[code]............

View 1 Replies

Converting String To Proper Datetime Value?

Jun 15, 2009

I have a datareader reading Date feild from the CSV file as string. it retreives the first record as "03/06/2009" successfully. My system datetime format is dd/MM/yyyy when I insert these values to an access table it put 06/03/2009 i.e makes it 6th March 2009 instead of 3rd June 2009 and so on for the values upto 12th June....after that it starts treating the date monthly correctly..

View 11 Replies

Find The Proper DLL With The OpenSqlFIlestream API Objects?

Oct 2, 2009

find the proper DLL with the OpenSqlFIlestream API objects so i can sue them in VBA/Access. trying to import either sqlnclient.dll or sqlncient10.dll both produce a "Can't add reference to the specified file." error. How do I get these objects into my environment so VBA recognizes and can use them?

View 6 Replies

Get Proper Time Format From DateTimePicker?

May 12, 2012

I have a DateTimePicker to display time (for example) as 05:00:00 AM or something like 07:00:00 PM. When I save my form's data, I'd like to save the time as 05:00:00 or 07:00:00, dropping the AM/PM extensions.

View 7 Replies

Login To My Router / App With Proper Credentials?

Feb 23, 2011

I need to find a way to login to my router/ap with the proper credentials and read from a designated textbox from the router's page and then virtualy submit some input that I might enter in my program to go as like a textbox.

View 3 Replies

Looking For A Proper Usage Of Socket Option?

Jun 22, 2010

As there is almost no documentation for this, I would like to know hot to properly use in VB NET 2008 the keep alive socket option.

Tried this: myTcpClient.Client.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.KeepAlive, 1)

but then the TCP does not connect any more, and how do I know when the connection brakes ?

View 3 Replies

Proper Syntax For Importing The VB6 Compatibility In .net?

Apr 22, 2011

Anyone know the proper syntax for importing the VB6 Compatibility in .net?

Example:

Imports VB6 = Microsoft.VisualBasic.Compatibility.VB6

Doesn't seem to work anymore.

View 7 Replies

Proper Way To Compare Strings And Integers?

Jan 16, 2011

I suspect there is something wrong in my application, specifically in a part where I have to compare a couple strings and a couple integers.

[Code]...

However, for some reason, it is not returning true... also, I heard somewhere there were more proper ways to compare strings and integers.

View 1 Replies

Proper Way To Develop Database Applications?

Mar 28, 2009

Recently i had a discussion with someone about the proper way to develop a database driven (SQL Server) application.In his opinion i should design also the database inside the application.At this moment i design the database in SQL Managaement tool and use a custom class to connect to this database (or the one of the client) in my application.What are the cons and pro's of using the VS database designer inside my IDE?

View 4 Replies

Proper Way To Launch Multiple Processes/

Jul 12, 2010

I have a quenstion to discus: I'm using Process.Start() and somettimes it's not worked properly. I meanin start application instantly or with random delays, even with hang's. So, as i wrote in title, there is a some proper way to launch another aplication?

I'm trying to write a some sort of launcher for user specific application based on createble profiles. In each profile user can set a file name (*.exe) with must be launched one or several times.[code]....

View 8 Replies

Proper Way To Validate Two Numeric Boxes Against Each Other?

Feb 20, 2009

I have two Numeric "spinner" boxes on my form called, nrcStartNumber and nrcEndNumber. The valid range for these boxes is 1-9999 (set for the controls at design). My question is what is the proper way to validate the two controls against each other such that the nrcEndNumber is always greater than nrcStartNumber? A similar question would be the same thing with two datetimepickers (formatted to time) such that the end time is always after the start time?

View 5 Replies

Proper Way To Verify Characters Only In A Text Box

Nov 24, 2009

I can not find the proper way to verify characters only in a text box.I am having a hell of a time trying to understand all that.I have 3 errors in my code.One error is "Error-Reference to a non-shared member requires an object reference."the other two errors are in reference to an explicit conversion from string to double.strName is what I am using as my variable for the input of the name in txtName.text Below is my full code. "----" are used to separate the classes.Attached documents are in .PDF format and HAVE TO BE FOLLOWED to the letter.Pages 2 & 3 contains the UML diagram as well as how the project should look and the structure chart for the code. I am not truly sure if my DisplayReservation is what will work to use in the list box.Is there any other reference I could get to help me understand how to use a list box as the project requires.[code]

View 10 Replies

VS 2008 Proper Syntax To DELETE?

Dec 21, 2010

Is this the correct syntax to delete a record from a dataset? [code]

View 4 Replies

VS 2008 Proper Use Of Resources For A Class?

Jun 8, 2010

I am not sure of the proper, or best, way to use Settings and Resources. For now I use the default project wide My.Settings and My.Resources. I have a class that I would like to reuse in other projects, so adding project wide settings or resources in each project doesn't sound proper, nor does creating constants and variables within the class itself.I'm guessing there is a way to give a class its own resource file, and maybe even settings file, but I'm not sure how to do it. I tried adding a resource file with the same name (but with .resx extension) and I got a weird error saying I was trying to edit a resource that is apart of another project. I continued, but it didn't seem to be what I wanted and I wasn't sure how to access that new resource.

View 3 Replies

VS 2008 RichTextBox The Proper Solution?

Jun 20, 2009

I want to display some text for a user - blocks of text about "vendors" - that can be scrolled.

I might want the first vendor to be a different color - or be bold.

I might want certain fields in the "text blurb" about each vendor to be bold - or underlined - or a different color.

In VB6 I would have used a RTB - would that still be the solution??

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved