I'm using a "wsHttpBinding" with a reliable session. I'd like to keep the client-server connection endless open. Therefore I need to set the ReceiveTimeout to "infinite". Has the "ReceiveTimeout" an other purpose (e.g. client crash detection; detecting a hanging request; etc) or can I set it to "infinite" without problems?
I have a problem with my project. here is the problem:
My code for login is as follows:
dim conn as SqlConnection = New SqlConnection("Data Source.................) dim cmd as SqlCommand = New SqlCommand("Loguser",conn) cmd.CammandType = CommandType.StoredProcedure
[CODE]...
Now the error i get is that "there is a datareader associate with this connection that need to be closed"
I'm not even sure where to start. I would like to create something like the ADO DataReader but that works in a TCP Client/Server scenario.Basically, in the TCP Client, I want to be able to call a certain command in the TCP Server which will return a DataReader like object, which I can then iterate through such as:
while dr.Read from the client. In each loop, I would parse out the various fields as in a normal DataReader.The reason I want to do this is to gain the inherent efficiency of the DataReader object since it doesn't first load ALL of the data. To my understanding, the typical TCP Client/Server setup using streams, would first load all of the data on the server, then transport ALL of that data to the client for processing. I want to avoid that, and just stream the data as the client requests through the Read() command which means the connection will remain open to the server while the Read() command is being issued by the client, or until explicitly closed by the client.
I have a .mdf file that I open through an Open Dialog Box and use in a ConnectionStringBuilder (where I have the user instance set to True). Later, in one of my button clicks, I try to open the connection (connection.Open()). It then gives me an error as follows: "Generating user instances in SQL Server is disabled. Use sp_configure 'user instances enabled' to generate user instances."
Here is my code:
Option Strict On Imports System.Data.SqlClient Public Class frmMain
I am currently working on a login page using vb.net. I would like to know how to make connection to an access database and verify that the user logged in is a valid user
I am developing an application that is using a Jet database (Access 2007). The database is local to the project (e.g., on the same drive and in the project directory). Any time I attempt to access the database (to create another DataSet, etc., via designer, etc.), I get the ubiquitous "Failed to open a connection to the database" with: No error message available, result code: E_UNEXPECTED(0x8000FFFF). Opening the Database Explorer and attempting to attach to the database results in the above as well. There are no apparent locks on the file, etc., and I'm the sole developer for this.
I'm trying to a open a connection to a local database and no matter what I try it just won't work (I'm pretty new to SQL Server and VB for that matter) I tried using 'sqlconnection' with different connection strings but none of them worked or gave me any useful error messages so I tried using 'OleDBConnection' instead, this hasn't worked either and it gives me this error instead:"A first chance exception of type 'System.NullReferenceException' occurred in MyProgram.exe"
Here is the code I am currently trying:
Private Sub MemDetailsSearch_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ConnectionString = ("Provider = Microsoft.Jet.OLEDB.4.0;" & "Data Source = Database.sdf") DataConnect = New OleDbConnection(ConnectionString)
I installed SQLExpress 2008 on my computer this afternoon and have been trying to create a new database and open a connection to it. I found this code online and tried it:
Dim conStr As String = "Server=MSSMLBIZ;Database=;Trusted_Connection = yes"
Im using the code from [URL] as a starter, most of the code is the same. the chat system works fine but on the client a added a disconnect button "clientSocket.Close()" and as soon as i click that i get errors, on the client, this is the code...
Private Sub getMessage() For infiniteCounter = 1 To 2
[CODE]...
And this line...
serverStream.Read(inStream, 0, buffSize) gives me "Unable to read data from the transport connection: A blocking operation was interrupted by a call to WSACancelBlockingCall."
Now im talking the server, after the client clicks disconnect or closes by task manager, looses connection, etc the server crashes and gives me.
I keeping getting an error.Seems to be the connection string.Error happens at connection.Open()
Error Message:Cannot open database "C:UsersJEREDocumentsVisual Studio 2008ProjectsBaseball2009Baseball2009DatabaseBaseball2009.sd" requested by the login. The login failed. Login failed for user 'JERE-PCJERE'.
Imports System.Data.SqlClient Public Class Field Private Sub Field_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load[code]..........
I am trying to query a MSI to get the ProductCode from the MSI so I can later populate a script with the proper ProductCode.During debugging it "looks" like the database is open for read, however if I look at the oDB object I see this "Error = No further information on this object could be discovered" When it tries to do the OpenView on the SQL statement it throws an exception "OpenView, Sql" I believe that is because the MSI really isn't open for read?I have added the reference to the Microsoft Windows Installer Object Library version 1.0.0.0
Here is the code: (I pass the fully qualified path + filename of the msi)
Private Sub GetMsiProperty(ByVal sMSIFilePath As String) Const sReadMSIDataBaseErrorStr As String = "ERROR: Could not read MSI database!" Const msiOpenDatabaseModeReadOnly = 0
I have this sub as part of my login / logout system. When this sub is called to login users it works perfectly, but on logout it throws an error that doesn't make any sense to me.
[Code]...
This sets a nonsense email address so that when validate_session searches for a valid email/session combo in the db it trips the destruction of the sensitive session data.
The question boils down to this: Why is the error being thrown when the logout sub calls validate_session?
I have two datareaders: [Code] When i'm running the code i get this error in the highlighted line: "There is already an open DataReader associated with this Command which must be closed first." I used different variables in both readers, why do i get this error? do i have to open a new sqlConnection for this task?
and in class that starts new thread started every time users change some data(very often)
[Code]...
1. other parts of application are targeting other SQL server...just this adapter is updating only one row(table has two columns, some id and last time any of users changed something.
This reader is done in the form load event and is the very first thing done so I don't understand why it's telling me there is an open DataReader. I've also set MARS=True in my connection string so obviously it is something else.Here's my code and like I said the routine is called at the top of the form load event. The error occurs on the
I get the following message "There is already an open DataReader associated with this Command which must be closed first." Is the insert statement the most effiecient way to write to the table row by row?
Dim comment As String Dim cnx As Data.SqlClient.SqlConnection = SqlCnx.SourceDB Dim cmd As New Data.SqlClient.SqlCommand("select number,comment from [Comments]", cnx) Dim daComments As New SqlClient.SqlDataAdapter Dim bsComments As New BindingSource cmd.CommandTimeout = "360" cmd.CommandType = CommandType.Text cnx.Open()
The fact is I'm making an application, which users can install by using a Setup file...once installed the data in the database can be updated by a centralized server. To do this, they can insert a DVD/CD-ROM and export the necessary data towards it. I need to do it that way, because some of the users who really need this data will be using stand alone computers.The application gets it's data from a mdb-file and the connection remains open as long a person works with the application (maybe not the best way to do, but I know :-) )...when the user uses the application, he can perform an export...this exports the .ini-file and pictures (which works fine), but he also needs to export the mdb behind the application...I already tried connection.close() before and connection.open() after the System.IO.File.Copy...but that doesn't seems to work.
I'm trying to put together a quick example for another thread about treeviews, and I'm getting a problem when I have a recursive routine, getting the message.
Quote:
There is already an open DataReader associated with this Command which must be closed first.
I'm a tad confused as I am explicitly creating a new command every time through the loop, so I'm not sure (unless its something ADO is doing behind the scenes) how the datareaders higher up the tree are interfering.
Here's my code :
Private Sub SetupChildren(ByVal ParentID As Integer, ByRef ParentNode As TreeNode) Dim MyCommand As New SqlCommand("SELECT * FROM Groups WHERE ParentGroup=@ParentGroup", m_myConnection)
[Code]...
Obviously I could close the data reader down before calling the next level of recursion but it would prevent the code continuing the loop at the current level when it had finished processing children.