|
The equivalent code in C++ works fine for me, except that I am not trying to create the file in the root directory. Try C:\Temp\NewDb.Mdb (make sure that the directory exists and is not write protected). Also mke sure that the file really doesn't exist yet (leftover from previous failure).
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke
|
|
|
|
|
This worked: Try C:\Temp\NewDb.Mdb
Why is it that it can not be created in C:\ ?
Something else:
how can I check if the access database exists and how can I deleted?
Thanks Rob,
Martin
|
|
|
|
|
Security on the root directory typically permits only administrators/system to write there...
<br />
if(System.IO.File.Exists(@"C:\Temp\NewDb.mdb")<br />
{<br />
try<br />
{ <br />
System.IO.File.Delete(@"C:\Temp\NewDb.mdb");<br />
}<br />
catch(System.SystemException e)<br />
{<br />
System.Diagnostics.Trace.WriteLine("Delete failed: " + e.Message);<br />
}<br />
}<br />
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke
|
|
|
|
|
|
hi,
In sql server 2000 , i wan to debuf stored procedure.But when i go for debugging it simply execute and not go for debugging.Can u sole my problem.It is i think most important problem many of us have faced or facing.
|
|
|
|
|
How are you trying to debug the stored procedure? I usually just use Query Analyzer to debug stored procedures. Just right click on the stored procedure name in the treeview and click 'debug...'. It will open a dialog box to allow you to enter values for all the parameters, then you click 'Execute' to start debugging.
|
|
|
|
|
hello,
thanks for that but i know it already ,my problem is that when i go for debug it simply execute and not stops for single breakpoint .do u getting my point or not.
Please anybody knowing it...
|
|
|
|
|
Sorry,
Thats why I asked how you were trying to debug; I thought maybe you were tying to use the Visual Studio integrated debugging, which has not always worked well for me. I have never had any problems debugging in Query Analyzer, and I use it for all my stored procedure and trigger debugging.
I hope you can find a solution.
|
|
|
|
|
Sorry sir,
would u tell me which edition of SQL SERVER U HAVE INSTALLED ,i.e; personal,developer,standard,or any other.Is there any setting while installing for debugging stored procedure. Please tell me i am in very much need.
|
|
|
|
|
|
hello,
Actully when i right click on stored procedure after that i click debug then i got a pop up msg telling that,
"sp debugging may not work properly if you logon as 'local system account while sql server is configured ro run as service.You can open event viewer to see details."
"do you wish to continue?"
"yes","no","cancel"
I selected yes but it is simply not debugging.Even i login as 'sa'.Please tell me any other configuration is there or not
|
|
|
|
|
I am using SQL Server 2000 Developer edition. A setup with nothing special selected; I just clicked 'Next' and accepted all the defaults.
|
|
|
|
|
need to filter a dataset to a data view (.RowFilter). I want the functionality of the wild card character "_" which matchs any chartacter once, sometimes "?" is used but in dataset none are supported. Im sure there is a way around this using "%" (Matches any character any number of times) as a wildcard and the "Count()" function which is supported but i cant figure it out. This one is tricky any takers????
The users passes in a string to filter the dataset so i was thinking about using the lengh of this as a parameter in the filter string???????
|
|
|
|
|
Can you specify user account and password with Reporting Service / URL access?
I know you could with Reporting Service Web Service Library:
Dim rs As New ReportingService()<br />
rs.Credentials = System.Net.CredentialCache.DefaultCredentials<br />
'Or<br />
rs.Credentials = New System.Net.NetworkCredential(username, password, domain)<br />
<br />
... configure parameters and stuff...<br />
<br />
'Now, render with credential specified...<br />
result = rs.Render(reportPath, format, historyID, devInfo, parameters, _<br />
credentials, showHideToggle, encoding, mimeType, reportHistoryParameters, warnings, streamIDs)<br />
but... URL access... not so sure... any pointer? Thanks.
REFERENCE:
1. MSDN - Reporting Service Web Service Library
2. MSDN - ReportingService class - Render Method:
3. MSDN - Reporting Service - URL Access
Norman Fung (c)
|
|
|
|
|
when i use find method of DataRowCollection, it returns DataRow. i need to know the row number of this returned DataRow in the DataRowCollection. but i cant. how should encounter with this DataRow to find that number?
thanks
Rastegar
|
|
|
|
|
There is no IndexOf method either in DataTable.Rows or CurrencyManager.List. If your collection is huge you can use the following function
public int GetIndex(DataRow findRow) {
for (int i = 0; i < _dt.Rows.Count; i++) {
DataRow row = _dt.Rows[i];
if (row == findRow) {
return i;
}
}
return -1;
}
Alomgir Miah
Live Life King Size
|
|
|
|
|
The IndexOf method is available in .NET Framework 2.0.
|
|
|
|
|
dim conn as new oledb.oledbconnection("provider=microsoft.jet.oledb.4.0;user id=admin;data source = f:\emp.mdb")
conn.open()
DIM CMD AS NEW OLEDB.OLEDBCOMMAND("SELECT * FROM EMP",CONN)
DIM ADP AS NEW OLEDB.OLEDBADAPTER(CMD)
DIM DS AS NEW DATASET
DIM DT AS DATATABLE
DIM DR AS DATAROW
ADP.FILL(DS,"EMP")
DT=DS.TABLES("EMP"
DR=DT.NEWROW
DR("EMPNO")=TEMPNO.TEXT
DR("ENAME")=TENAME.TEXT
DR("SAL")=VAL(TSAL.TEXT)
DT.ROWS.ADD(DR)
ADP.UPDATE(DS,"EMP")
ADP.FILL(DS,"EMP")
CAN ANYONE PLEASE GUIDE ME IN THIS CODE, I WANT TO INSERT THE NEW RECORD IN TO THE TABLE
WITHOUT USING THE DATABASE CONTROL. THE ABOVE CODE IS NOT INSERTING THE VALUES INTO THE TABLE. HOW TO INSERT, UPDATE, DELETE RECORDS INTO THE TABLE WITHOUT USING DATABASE CONTROLS IN ADO.NET
|
|
|
|
|
Did you provide an InsertCommand command object for the dataAdapter? (retorical question, clearly you did not, judging from your code). The constructor you used only sets the SelectCommand command object for the dataAdapter. You still need to provide the insert and update ones...
btw YOUR CAPS KEY IS STUCK. THAT MAKES ME THINK THAT YOU ARE SHOUTING, which is rude...
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
The opposite of the religious fanatic is not the fanatical atheist but the gentle cynic who cares not whether there is a god or not.
Eric Hoffer
|
|
|
|
|
IMO you should update / insert only with stored procedures.
Here is an example of how I would code an insert statement.
Dim conn As New SqlConnection
conn.ConnectionString = Session("ConnectionString")
Dim cmd As New SqlCommand
cmd.Connection = conn
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "prc_Update_Notation_Types"
Dim Prm1 As New SqlParameter("@Original_Type", SqlDbType.VarChar, 50)
Prm1.Direction = ParameterDirection.Input
cmd.Parameters.Add(Prm1)
Prm1.Value = DBNull.Value
Dim Prm2 As New SqlParameter("@New_Type", SqlDbType.VarChar, 50)
Prm2.Direction = ParameterDirection.Input
cmd.Parameters.Add(Prm2)
Prm2.Value = Me.txtNotationType.Text
Dim Prm3 As New SqlParameter("@Type_Description", SqlDbType.VarChar, 50)
Prm3.Direction = ParameterDirection.Input
cmd.Parameters.Add(Prm3)
Prm3.Value = Me.txtNotationDescription.Text
conn.Open()
cmd.ExecuteNonQuery()
conn.Close()
"People who never make mistakes, never do anything."
My blog
http://toddsnotsoamazinglife.blogspot.com/
|
|
|
|
|
That, however, was not the question posted, and your answer sheds no light on the original problem.
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
The opposite of the religious fanatic is not the fanatical atheist but the gentle cynic who cares not whether there is a god or not.
Eric Hoffer
|
|
|
|
|
respected members thanks for ur response
one of the member was giving the sugession that we have to provoide the insert command. do you mean that i have to use (INSERT INTO) command of SQL at last to inserst rows to the table. when I use the SQL insert command the data's are getting added. I want to known whether there is any other method of storing data's in to the table without using SQL command or Data contorls to the forms.
i have given one statement DR=DT.NEWROW, this inserts an row is added to the datatable, it means that i am in iserting mode and atlast after moving the values to the datarow, the dataadapter is updated & filled. kindly guide me what showed be the actual procedure to be follwed to insert,update & delete records programatically with out using form controls.
|
|
|
|
|
Hi all
There are two ways to do this; either design the adapter and dataset at design time. If u design it in design time, system will automatically create update, insert & delete command for adapter.
System generated insertcommand for sql adapter :-
INSERT INTO Link_Policy(BatchID, TransNo, BarCodes) VALUES (@BatchID, @TransNo, @BarCodes); SELECT BatchID, TransNo, BarCodes FROM Link_Policy WHERE (BatchID = @BatchID) AND (TransNo = @TransNo)
Otherwise, create the adapter and create each sql command [just like select command] and assign it to adapter.
Ammu
|
|
|
|
|
The dataadapter has 4 different command objects, on each for select, update, insert, and delelte. The coinstructor you used creates and initializes the selectCommand object with the Select string you pass it. If it did not, then selection (and Fill) would fail. The other three are left up to you. You can either create them manually as new oledbCommand objects with the desired SQL for the command statement, or wrap the dataadapter in an oledbCommandBuilder, which will build the command objects for you (table must have a primary key for this to work). Alternatively, you can create the adapter in design mode, and add the insert (etc) comannds there.
This example from the MSDN docomentation shows how to use the oledbCommandBuilder:
OleDbConnection myConn = new OleDbConnection(myConnection);
OleDbDataAdapter myDataAdapter = new OleDbDataAdapter();
myDataAdapter.SelectCommand = new OleDbCommand(mySelectQuery, myConn);
OleDbCommandBuilder cb = new OleDbCommandBuilder(myDataAdapter);
myConn.Open();
DataSet ds = new DataSet();
myDataAdapter.Fill(ds, myTableName);
myDataAdapter.Update(ds, myTableName);
myConn.Close();
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke
|
|
|
|
|
Hi All,
I execute the following code:
con.Open "server=(local);database=pubs;uid=sa;pwd=apwd;driver=sql server;app=testapp"
MsgBox "Click ok to close connection"
con.Close
Once I all the con.close, it takes approximately 1 minute for the connection to the sql server to be released. I have verified this by doing a sp_who2 in query analyser and by looking at connections in the perf mon.
I am having this problem with C++ using ADO.net via smartpointers, and C# using ado.net. The apps are not using connection pooling, and my simplest test above involves only the above code actually running, i.e. no other apps are running
Can anyone tell me why the connection is so slow to release, and how i can resolve this?
Thanks in advance,
Q
Quintes
|
|
|
|