DB/Reporting :: Different Types Of Connections In .Net 08 ?
Aug 28, 2009
The current project that I'm working on is mainly employing a database back-end, and I have a few questions regarding database connections in .Net, before I actually convert.
For VB6, I connect to my databases using ADODB connections and recordsets in code only, and not by binding controls. I perform my queries using SQL statements..For differentations in the type of database, such as connecting to a MySql, a MsSql, or an access database, it was mainly the connection string that had to be changed.. and ofcourse installing the drivers.
Now for VB.Net, I believe this can be done using the System.Data assembly. While looking into it, I've seen that it has a lot of members, such as System.Data.Odbc, System.Data.OleDb, System.Data.SqlClient.
My question is, what is the main difference between those namespaces (just briefly)? I would like to generally understand the main differences before I start with anything. I have also heard about LINQ. It looked very alien to me in the MSDN library. (PS: what's the deal with Ado.Net?)
View 6 Replies
ADVERTISEMENT
May 29, 2009
In our VB 2008 we are making a lot of connections to sql server 2005 databases. Is there a possibillity to check with a program or a tool of 2005, all connections are closed?
View 3 Replies
Jul 19, 2011
Using VB.Net and SQL Server 2008 R2: I have recently had a database that using sp_who2 reflects a connection ".Net SqlClient Data Provider" is still active even though the .Net application has closed and disposed of all connections.
[Code]...
View 1 Replies
Jul 6, 2011
I have written an application which manages some bookings, and want to use Crystal Reports to provide the reporting engine. I have used it before with datasets with no problems.
I am using EF4, and have a LINQ query and report datasource assignment as below:
Code:
Dim ActiveCustomers = From Customer In FMEntities.Customers
Where Customer.Status = 1
Select Customer
[Code].....
I have read up that I may need to convert the incoming data, but I am confused as to what it needs to be converted to. Should it be a datatable?
View 1 Replies
Nov 1, 2009
I have a class with a Property called 'Value' which is of type Object.Value can be of any type, a structure, a class, an array, IList etc.My problem is with the setter and determining whether the value has changed or not.This is simple enough for value types, but reference types and lists present a problem.For a class, would you assume that the Equals method has been implemented correctly, or just assume that the value has changed every time the setter is called?If I did assume it's changed, then perhaps I should assume it for value types as well, so that the behaviour is consistent.
View 2 Replies
Jun 23, 2012
I need to compare two dictionary values if the types stored are equal, this is what i have
if gettype(Args(key)) = gettype(argtypes(key)) then
'' do something
end if
[Code]....
View 1 Replies
Jun 6, 2010
I'm populating a listview with a list of databases on a selected SQL instance, then retrieving a value from each database (It's internal product version, column doesn't always exist) I'm calling the below function to populate the second column of the listview:
[Code]...
View 2 Replies
Feb 23, 2011
I'm trying to understand how to handle db connections in a multi-theaded windows program.It I have this simple class:
public class MyClass
private myConn as new sqlconnection
private MyThreadPool(5) as Thread
[code]....
View 10 Replies
May 24, 2012
I searched araound and having some difficulties in implementing one scenario with SQL Server 2000 and sybase.I have two SQL servers on different locations naming ServerA (MSSQL Server) and ServerB (Sybase server).I have a table called SALARY.Whenever I insert one record to customer SALARY in ServerA, I also will insert it into ServerB.If should any of them failed, both of them should be rolled back.I am using Asp .Net with VB for the programming.I do not have the right to change / add table in Server B. The only thing allowed in Server B is insert/delete/update record.I looked around and find a method to use TransactionScope but I am not quite sure it is the right way to do.url...
View 1 Replies
Dec 17, 2010
I am developing an Application that uses TCP To listen for connections, and then when a message is sent to the server and then it alerts the IP that is running the server. (Lets say the server is on a iPhone, and some how the iPhone gets a text message, which alerts a tcp server running in the background via a .jar, it would send the owner of the iPhone a message on the computer telling it it has a text. This is just an example though, but I think it gets the general idea across. I've been trying to do this, and I can connect to a TCP Server (using 127.0.0.1:8888 for testing purposes, will move to a solid IP and Port later). I can start the server (its still buggy and under development) but i don't know how to connect to the server via an application, and when a certain message is received to alert the IP Running the server.
My Server Code is:
Dim serverSocket As New TcpListener(8888)
Dim clientSocket As TcpClient
Dim infiniteCounter As Integer
Dim counter As Integer
serverSocket.Start()
[Code] .....
Now I know that to connect you'd do something like
Code:
Dim clientSocket As New System.Net.Sockets.TcpClient()
Dim serverStream As NetworkStream
clientSocket.Connect("127.0.0.1", 8888)
serverStream = clientSocket.GetStream()
And I know I would have to use some sort of Byte() method to send/receive messages, but I am at a loss on how to set it all up.
View 3 Replies
Apr 22, 2010
I need to download a bunch of pages from a web server, ie. spidering. I know that servers are typically configured to only allow a couple of concurrent connections from a given IP, but that would already halve the total time to run the script instead of downloading one page at a time.
View 4 Replies
Jul 28, 2009
i've been previously using Visual Studios built in wizards for manipulating data access to and from an MSAccess Database, however just recently i coded my own classes and connections to the database, ive been able to select, update and delete records effectively however my problem comes with inserting records.
I have a 3 tiered table database:Tbl_PO, Tbl_Parts, Tbl_Shipments each po has multiple parts, each part has multiple shipments.when i insert a record into the tbl_PO, i need to retrieve the ID used on that insertion.
View 4 Replies
Feb 15, 2012
I am using two SQL connections in my Program. I declare them like this:
Public SQLcon As New SqlConnection("server=(local);database=master;Trusted_Connection=True;")
[code].....
View 5 Replies
Feb 20, 2010
How do I go about closing a connection if I redirect before I can close it? Does it close when the new page loads? For example:
[code].....
View 3 Replies
Aug 14, 2009
This thread (Question) is a continuation of a question answered by JohnWein. the original question asked by me in this thread:http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/4d9b44a0-91ed-4f64-a3a2-74afffce2256 an this is the answer:
[Code]...
The question is, in the case of four connections, how can I make sure that all points are connected with minimum number of connections using the same above code?
View 1 Replies
Nov 7, 2011
I have a Visual Studio 2008-SQL Server 2005 app that will be throwing alot at it. It's my testbed learning app. I'm also a student of this craft(43 years young) like another poster posted on another thread. I come from a PICK/BASIC jBase background. Anyway as-is my app has a connection to the database that is opened on form load. I close the connection on form close. It's a one form app currently. Is this wrong? It seems that maybe I should not have a connection opened possibly all day. I'm looking into incorporating Datasets, dataAdapters into my next phase of evolution. I looked at the material and it's tough. For me anyway. But I will get into it. I will fetch the data into a dataset so that I can keep the connection open only for a little while. I was turned on to this "keep the connection just as long as you need it" idea from someth
View 3 Replies
Jun 25, 2010
I am making a web browser and I was wondering how I could create connections through proxies. Right now the browser only uses UDP packets, so any info specifically on that would be great.
View 8 Replies
Oct 14, 2010
i'm using Visual Basic 2008 - Office 2007 - addin for ppt.
ok i'm going to delete the other thread. i'm going to rephrase and try to explain as clearly as possible.
I need to find a code that (when i click the "Search" Button) will start searching for all available lan and wireless connections.
All the available selections will be shown in a List Box provided.
Once i find one i want to use, i can stop the search (by pressing another button "Stop" in this case) or just straight away click the one i want and press another button ("Select" in this case) and if it needs a password or WEP then it will display or it will just connect without asking.
View 10 Replies
Feb 26, 2009
Im making a small servermanager for a game. I have a list of players with their IP's that are currently connected to the the whole game. I want to find out what IP's are connected to a certain process so I can match these with the list of players and then add the players that are in the server hosted by this servermanager, into the playerlist.Adding players to that list and looking them up for a matching IP already works. I just cant figure out how to find all the IP's that are connected to a certain process.
View 1 Replies
Dec 17, 2010
I'm using a TcpListener and TcpClient to search for a connection on a certain port,and display a message when a connection is made, but i do not know how to do this. My code so far:
Dim port As Integer = 81
Dim serverSocket As New TcpListener(port)
Dim clientSocket As TcpClient
Dim c As Integer
Dim ic As Integer
[Code]..
View 1 Replies
Jan 12, 2010
I wrote application which displays tcp connections to the PC, but how can i terminate them? [code]...
View 2 Replies
Nov 14, 2010
OK here is some code I nicked from web and I have changed some things, it works but only accepting one client, how do I make this accept multiple clients?
[Code]...
View 2 Replies
Mar 11, 2011
I searched on google for these terms : "How to see all open connections in vb.net" and it should be for a server im running and it would be like to see witch users are connected (ip) and then if i type in the console -disconnect ip then the user will be disconnected from the server but is this technical posibble ?
View 4 Replies
Feb 7, 2012
I am currently working on an asp.net web page with a GridView displaying a table from a database.This GridView has 4 DropDownLists that will be used to filter the data shown on the GridView. When the page loads 4 Sub routines are run, each one connecting to the database with a select statement to fill the DropDownList with relevant filter headings.
Initially, I had one connection with a loop that populated all of the drop downs but these contained duplicates. I then split the filling of each DDL so that the select statements could contain DISTINCT. I would like (and am sure there is a way here) to be able to populate all of the DDLs with data from one connection.
Code for one connection:
Protected Sub FillDepDDL()
Dim conn As New SqlConnection()
conn.ConnectionString =
[code]....
The other 3 column names: FirstName > DDLFN, LastName > DDLLN, Wage > DDLWag.This is only a test DB and the princibles learned here will be applied to a larger live project.
View 1 Replies
Jan 3, 2010
I was wondering, if there is a way to block incoming connections from specific ip adress that tries to connect to computer
I assume that it cant be via windows host files
View 5 Replies
Jul 8, 2009
I need to change the connection string of all tableadapters at runtime, can anyone tell me for the best way to do it?I have a conection string in my settings, that i can't change at runtime (application scope), i could go to dataset.designer and change the value to a new variable but i don't think this is a good method.
View 3 Replies
Aug 24, 2011
I'm pretty new to VB.NET and connecting to SQL Server.What is considered best practice when building an app that needs to connect frequently to a SQL Server DB to fetch, write, delete and update records?Should a connection be opened at app startup (a connection at start is opened to validate the user) and left open for subsequent transactions or should a connection be opened, closed and disposed of each time a read/write to the DB is required?
View 3 Replies
May 28, 2009
I'm using an xsd file for a couple of my data sets that I'm using to read access databases. While this is great, I just got a new requirement that allows the user to change the link to the access database on their computer. Is there any way to allow them to set the path while still being able to use the xsd files, instead of doing it all through code?
View 2 Replies
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
Oct 8, 2010
I am new(ish) to Visual Basic and i have learned from looking at old VB6 code for programs that have been made for us in the past, this includes using the old ADODB connections and FlexGrids which both have been changed in VB.Net to OLEDB and DataGridView.I have started to understand the way the connections and datasets etc are created but i am struggling to get to where i was with the old code (I am trying to completely upgrade the code from FlexGrid).This is the VB6 Code i am trying to upgrade from:
[Code]...
View 14 Replies