System.NullReferenceException thrown but can't be caught
In ADO.NET has anyone ever seen a case where you get an:
Unhandled Exception: System.NullReferenceException: Object
reference not set to
an instance of an object.
during an IDbCommand.ExecuteReader call just out of
nowhere and your try/catch block not handle it? I have a
SQL query running through an OracleConnection, and I
frequently get this exception thrown and there's nothing I
can do to handle it.
The query can run for about an hour or so, and then this
exception gets thrown within my try/catch block, but it
can't be caught. I catch on both NullReferenceException
and Exception and neither one of them catches this
exception.
Thanks,
Scott Tag: get current identity of a table error??? Tag: 67316
Can't Delete registers in a Acces DB
Hi:
I have this problem when I try to delete a record and
then Update the DB, the record is not deleted. I can add a
record but I can't delete it.
This is the procedure Iam using, for Update:
Dim fila As Data.DataRow
Dim i, j As Integer
Dim lwItem As ListViewItem
Dim columna As Data.DataColumn
'
Try
For i = 0 To ListaTablas.Items.Count - 1
lwItem = ListaTablas.Items(i)
fila = CType(ListaTablas.Items(i).Tag,
Data.DataRow)
fila.BeginEdit()
j = 0
For Each columna In dbDataSet.Tables
(NombreTabla).Columns
If j = 0 Then
If columna.AutoIncrement = False
Then
fila(j) = lwItem.Text
End If
Else
If columna.AutoIncrement = False
Then
fila(columna.ColumnName) =
lwItem.SubItems(j).Text
End If
End If
j += 1
Next
fila.EndEdit()
Next
dbDataAdapter.Update(dbDataSet, NombreTabla)
dbDataSet.AcceptChanges()
Catch errActualizar As Exception
MsgBox(errActualizar.Message)
End Try
Thanks on advance
Javier Ayala Tag: get current identity of a table error??? Tag: 67314
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: get current identity of a table error??? 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: get current identity of a table error??? 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: get current identity of a table error??? 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: get current identity of a table error??? 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: get current identity of a table error??? 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: get current identity of a table error??? 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: get current identity of a table error??? 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: get current identity of a table error??? 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: get current identity of a table error??? 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: get current identity of a table error??? 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: get current identity of a table error??? 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: get current identity of a table error??? Tag: 67286
DataGrid and DataReader
How can i use DataReader with Datagrid paging ?
Excuse me for bad english... Tag: get current identity of a table error??? Tag: 67283
ado.net & access
is it possible to fetch data with ado.net from a access database?
greetz, Martin Tag: get current identity of a table error??? Tag: 67281
ado.net & access
is it possible to fetch data with ado.net from a access database?
greetz, Martin Tag: get current identity of a table error??? Tag: 67279
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: get current identity of a table error??? 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: get current identity of a table error??? 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: get current identity of a table error??? 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: get current identity of a table error??? 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 t