Problem about showing ErrorIcon and Error tooltip text in the dgv.
Hey all,
I tried to show both error Icon and error tooltrip text when the error
is raised.
The cell ErrorText is set in the CellValidating event handler function
in my dgv like followings,
if (Convert.ToInt64(e.FormattedValue.ToString()) > 65535)
{
_cell.ErrorText = "65,535 error!";
_cellErrorAppears = true;
}
if (_cellErrorAppears)
{
if (_cell.Tag == null)
{
_cell.Tag = _cell.Style.Padding;
_cell.Style.Padding = new Padding(0, 0,
25, 0);
cellInError = new Point(e.ColumnIndex,
e.RowIndex);
}
if (errorTooltip == null)
{
errorTooltip = new ToolTip();
errorTooltip.InitialDelay = 0;
errorTooltip.ReshowDelay = 0;
errorTooltip.Active = false;
}
e.Cancel = true;
In dgv_CellPainting event handler, the error icon is depicted by the
following,
if (dgv.IsCurrentCellDirty && !String.IsNullOrEmpty(e.ErrorText))
{
// paint everything except error icon
e.Paint(e.ClipBounds, DataGridViewPaintParts.All &
~(DataGridViewPaintParts.ErrorIcon));
// now move error icon over to fill in the padding
space
GraphicsContainer container =
e.Graphics.BeginContainer();
e.Graphics.TranslateTransform(18, 0);
e.Paint(this.ClientRectangle,
DataGridViewPaintParts.ErrorIcon);
e.Graphics.EndContainer(container);
e.Handled = true;
}
When the mouse move to the cell, the error tooltrip should show
itself. However, it doesn't. Moreover, when the cell is edited once
more with the wrong input, the error Icon disappear as well.
In dgv_CellMouseMove()
{
if (cellInError.X == e.ColumnIndex &&
cellInError.Y == e.RowIndex)
{
DataGridViewCell _cell = dgv[e.ColumnIndex,
e.RowIndex];
if (_cell.ErrorText != String.Empty)
{
if (!errorTooltip.Active)
{
errorTooltip.Show(_cell.ErrorText, dvg, 1000);
}
errorTooltip.Active = true;
}
}
}
In dgv_CellMouseLeave()
{
DataGridViewCell _cell = dgv[e.ColumnIndex, e.RowIndex];
Font regularFont = new Font(dgv.Font, FontStyle.Regular);
_cell.Style.Font = regularFont;
}
The code in the CellEndEdit event handler is as follows,
dgv_CellEndEdit()
{
if (dgv[e.ColumnIndex, e.RowIndex].ErrorText != String.Empty)
{
DataGridViewCell _cell = dgv[e.ColumnIndex,
e.RowIndex];
_cell.ErrorText = String.Empty;
cellInError = new Point(-2, -2);
_cell.Style.Padding = (Padding)_cell.Tag;
if (errorTooltip != null)
{
errorTooltip.Hide(dgv);
errorTooltip.Dispose();
errorTooltip = null;
}
}
}
Can anyone give me a hand with this problem?
Thanks in advance. Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140787
Undo, redo functions in dgv.
Dear all,
I met two problems.
1. "Undo" only worked when the XML file was loaded. However, it didn't
work when the new row is added in the dataTable ["a"] in dvg.
There are dgv, dataset and target xml file in my application.
Therefore, I wrote the codes as follows in the "Undo" button handler
function.
if (dgv.IsCurrentCellInEditMode)
{
// Nothing. If cell was in the EditMode, then cellMenuStrip will
show up when user right clicks on the cell.
}
else
{
DataTable _dt = dataSet.Tables["a"];
_dt.RejectChanges();
}
The problem is happening at the point _dt.RejectChanges(), due to the
reason that it can't be evaluated. (I don't know why.) The principle
in my "add row in table" is, e.g. new row is added in the dgv, then
update the bounded dataSet afterwards. The table["a"] in dataSet
worked correctly.
2. Is it possible for me to add the "redo" function in the
CellContextMenuStrip?
3. How shall I implement the "redo" in the dgv?
Thanks in advance,
Rush Hour. Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140786
Problem about moving the rows in the dgv + XML + dataSet.
Hey,
In my application, I have to manipulate the XML file in the dgv, which
is bounded by DataSet. E.g. move the selected row in the dataTable "p"
which is in the DataGridView dgv "up" and "down", then save it to the
DataSet. Can you give me a hand with it? Or do you have any code
samples to make it in C# or some language related? The code that I am
thinking about now is,
dv = new DataView(dataSet.Tables["p"]);
dgv.DataSource = dv;
However, I don't know how to move the selected row.
Thanks in advance,
Best Wishes, Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140785
Fighting with typed data set and child relation
Hi,
the problem I have, is that the GetChildRows() method does not work. I
get error:
Unable to cast object of type 'DEBTORRow[]' to type 'DEBTOR_NACERow[]'
>From the database (oracle10gR2 using Oracle .NET provider v2.0.50727)
I generated a typed dataset in VS2005. There is a 1:n-relation between
DEBTOR and DEBTOR_NACE. Using the object browser I can see that class
DEBTORRow has a GetChildRows method. The VS generated the follwoing
code from the data set designer:
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public DEBTOR_NACERow[] GetDEBTOR_NACERows() {
return ((DEBTOR_NACERow[])
(base.GetChildRows(this.Table.ChildRelations["R_DEBTOR_NACE_DEBTOR"])));
}
So there are number of things I don't understand here:
(1) the code above looks correct; why do I get the error mentioned
above when I call GetChildRows() like this:
DEBTOR_NACERow[] drNaceRows = drDebtor.GetDEBTOR_NACERows();
Note that drDebtor is of type DEBTORRow
(2) If I check the code generated by the data set designer, I can see
that this relation is added to the relations collection of the data
set class in InitClass() method:
this.relationR_DEBTOR_NACE_DEBTOR = new
System.Data.DataRelation("R_DEBTOR_NACE_DEBTOR", new
System.Data.DataColumn[] {
this.tableDEBTOR.DEBTOR_SEQColumn}, new
System.Data.DataColumn[] {
this.tableDEBTOR_NACE.DEBTOR_SEQColumn},
false);
this.Relations.Add(this.relationR_DEBTOR_NACE_DEBTOR);
I expected that this relation is also added to the relations
collection of the data table for DEBTOR. But it is not. So how can
this.Table.ChildRelations["R_DEBTOR_NACE_DEBTOR"] work at all in
GetDEBTOR_NACERows()?
Am I making something wrong or is the code generated by the data set
designer wrong?
Thanks,
Stefan (C# newbie) Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140784
Updating and Merging with Order Details
My question is do merges always take place using the original values of =
=
primary key fields ?
For example using the Northwind Order Details table:
1. The primary key is OrderID and ProductID.
2. The user can change the ProductID which changes the primary key.
3. Both the original ProductID and the current ProductID must be returne=
d =
to SQL Server to enable it to identify the row affected using the the =
OrderID and the original ProductID.
4. The ProductID for the affected record is updated to the new value.
5. A select query then returns the other fields in the record to the =
GetChanges DataTable using the OrderID and the now current (NOT the =
original) ProductID in the WHERE clause.
6. The GetChanges DataTable is then merged with the Order Details =
DataTable in the DataSet.
The above scenario produces an error.
In order to prevent the error and get the correct result, i.e. what is =
effectively a row being overwritten by identical data in this instance, =
I =
have to do the following on the RowUpdated event:
' Suppress AcceptChanges for updated rows to preserve the original =
ID =
values.
If e.StatementType =3D StatementType.Update Then
e.Status =3D UpdateStatus.SkipCurrentRow
End If
I can only assume this is necessary because merges on primary key fields=
=
match up records using the original values of the primary key fields and=
=
not the current values?
Des
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140779
SqlDataReader and null fields
I am returning data using a SqlDataReader. Here is a snippet of code where
I am having a problem. What is the best way to handle nulls?
private void TGenerateJobSiteList2FromReader<T>(SqlDataReader returnData,
ref List<JobSite> jobSiteList)
{
while (returnData.Read())
{
JobSite jobSite = new
JobSite((string)returnData["JobName"], (int)returnData["JobSiteId"],
(string)returnData["Addr1"], (string)returnData["Addr2"],
(string)returnData["City"],
(string)returnData["state"]);
jobSiteList.Add(jobSite);
}
} Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140774
ADO.NET driver for MySQL?
Hello,
I have dowloaded two drivers for MySQL:
- mysql-connector-net-1.0.9.zip
- ByteFX.MySqlClient.76.NI.zip
Which one do you recommend?
Please help
Thank you!
RAM Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140773
ObjectDataSource
I am using an ObjectDataSource to populate a GridView. The ObjectDataSource
accesses the data in the table by means of a Stored Procedure using a
SQLCommand.ExecuteReader. Does this mean that I can't easily do sorting,
filtering and paging in my GridView
Bill Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140769
Linq group
Is this gonna be the place for Linq questions (not the windows forum)?
--
William Stacey [C# MVP]
PowerLocker, PowerPad
www.powerlocker.com Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140768
DataGrids with Multiple tables
Hi, I want to have a DataGrid with two columns - 1 from one table and
one from another. The tables are linked by a key from the 2nd to the
first. I am using a DataSet in .Net and the tables are in the DataSet
and there is a relationship between that tables in the DataSet. I have
been able to get a column populated with data from one table, but I
don't see how to reference the 2nd table. Is this possible? Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140764
UPDATE TOP (1)?
I'm using the OLEDB provider against an Access Database. I need to update
just one record. Is there any way to do something like this?
UPDATE TOP 1 [Articles] SET [Status]='MyClientID' WHERE [Status]=''
I only want to update one record, because i'm going to select that record in
the next statement by using:
SELECT * FROM [Articles] WHERE [Status]='MyClientID'
Any suggestions or guidance?
Thanks. Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140760
ADO.NET Hangs-up(does not return) when executing SQL Batch Satetme
I have encountered a wiered problem.
I am using visual studio 2005, Oracle 8.1 and OracleClient.
ADO.NET works fine even for batch statement, but for some reason, it
hangs-up and never comes back, when executing the statement like this.
BEGIN
RDS.GENERATE_FORMULA_BATCH('2395589','100','02-Aug-2007','02-Aug-2007','HSDEMO5',NULL,NULL,1,46,NULL,NULL);
RDS.GENERATE_FORMULA_BATCH('2395605','100','02-Aug-2007','02-Aug-2007','HSDEMO8',NULL,NULL,1,46,NULL,NULL);
END;
when i execute in SQL navigator it comes back with Error(that is generated
by trigger as business logic error), but i expect AD.NET as well to return me
an error, instead it never comes back.
Cmd.Connection = Cn
Cmd.CommandType = CommandType.Text
Cmd.CommandText = SQL
Cmd.ExecuteNonQuery
Just wanted me highlight, that i have several such SQL Statements which runs
fine, but this fails & hangup .
Any help is appreciated Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140757
Oracle Client and ADO.NET
I'm considering using MS .net provider for oracle to connect to an
oracle 10g R1 DB.
I was reading thru some documents and it seems that an oracle client
must be installed so i can use this provider.
However, how do I go about installing the client? I have Developer
Suite 10g (9.0.4), but I am not able to select from the installer
which components to install. I am given only 4 options (J2EE
installation, Rapid App Dev Installation, etc... but no custom
option).
What are my options?
Another thing to consider in this is that there already exists a
default home installation (pretty old forms/reports 6i) which MUST be
present on our production environment. So I have to install the new
Oracle Client in another oracle home. Will I be able to use the .net
provider for Oracle in this scenario?
Of course I can use OLEDB/ODBC providers instead if this doesn't work.
Thanks Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140755
Dataset.DataTable.Fill() in .net 1.1
Hi,
I'm very impress with .net 2.0 which Dataset already combine with Adapter,
so I can do like "Dataset.DataTable.GetData()" in order to get and polulate
data into dataset in specific datatable.
Unfortunately in my office still using VS.net 2003/.net 1.1. Normally I'm
using like this method to retrieve GetData(Dataset.DataTable), it fill
dataTable with the data.
How do I create a new class as data logic layer which inherits from Dataset
with addition method Adapter (eg: Fill, Update). So I can do
"Dataset.DataTable.GetData()" in .net 1.1. In nut shell, how do I emulate
.net 2.0 in ADO.net 1.1?
Best Regards,
Martin Adhie Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140753
Using DataAdapter.Fill to return a DataTable complete with schema information
When I use a DataAdapter and call its Fill method to populate data into a
DataTable, most of the DataTable's schema information is missing: all the
column MaxLength values are set to -1, Nullable is set to True for all
columns, Identity to False for all columns, etc. This is a real nuisance.
I'm therefore trying to find a way to get a DataTable filled from a
DataAdapter with the schema information also present.
My initial approach to this was to call ExecuteReader on the DataAdapter's
SelectCommand, and then call GetSchemaTable upon the reader. This gives me
all the column information I need. I then manually create the DataTable's
columns, adding in all the appropriate values. Finally I loop through
calling reader.Read() to get all the row data, and add the rows to the
DataTable too.
This works, but the resulting DataTable isn't associated with the
DataAdapter (I didn't call DataAdapter.Fill at any stage). When I try to
update this table using DataAdapter.Update(DataTable), all kinds of odd
things happen and my changes aren't written to the database.
So question 1: is there some way I can properly associate this
manually-created-and-populated DataTable with the DataAdapter?
Failing that, I tried another approach. After calling DataAdapter.Fill() and
passing it my DataTable, I then called the
SelectCommand.ExecuteReader.GetSchemaTable method and populated all the
schema information into the existing DataTable. This works fine, but my call
to ExecuteReader results in the SelectCommand query being executed twice. As
some of my queries are complex and slow to run, I can't afford to do this. I
tried performing this step prior to calling the Fill method, but the
DataAdapter complains if I leave the reader open, and re-executes the query
if I close it.
So question 2: is there a way for me to obtain the reader object that
DataAdapter.Fill used without having to re-execute the query? Is there any
other way to get the schema information without re-executing the query?
My thanks in advance,
--
(O)enone Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140746
How to contruct a ConnectionString to connect to dataset?
Hi,
We have bunch of DataObejcts/BusinessObjects those used against
database. Now we fetch some data from database into a dataset. How can
we contruct a ConnectionString to connect to this dataset so we can
use those DataObejcts/BusinessObjects?
Thanks Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140737
LINQ to SQL: Opposite of SubmitChanges()
I'm working with the new Beta 2 of VS2008 and LINQ is really great but i'm
searching for an opposite construct of the SubmitChanges() method to discard
changes. Background:
I have a form for editing a single data row and only if the user clicks the
OK button the changes are saved into the DB. That's no problem to call the
SubmitChanges() method on the DataContext. Otherwise the last saved state
should be restored. An DiscardChanges() method on the DataContext would be
nice, because LINQ tracks the changes made on the objects so not submit the
chages isn't the solution or have I overseen something?
Thanks. Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140728
Update and Select in the same statement?
Is there any way to select a record and update a field in that record in the
same statement? I have a table that several threads will be querying. Once
the record has been selected by a thread, I don't want that record to be
selected by any of the other threads. So my thought was to have a "busy"
column that would be flagged true during the select. However, I don't see a
way to do it.
I'm working with an MDB file so I don't think triggers would be the answer
here. Suggestions anyone? Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140726
Problem with ImageButton.OnClientClick when DataBinding
I have the following tag in one of my DataList's ItemTemplates:
<asp:ImageButton ID="btnViewQuestion" runat="server" BorderWidth="0"
ImageUrl="images/qmark.gif" Height="27px" Width="26px"
OnClientClick="window.open(<%#
DataBinder.Eval(Container.DataItem,"questionid","'viewquestion.aspx?questionid={0}'")
%>,'question','scrollbars=yes,width=630,height=480,location=no,menubar=no,status=no,toolbar=no');"/>
As you can see, my goal is to use the value from the DataBinding Expression
as the first parameter of a JavaScript window.open() method in the
OnClientClick property of an ImageButton. However, when I run the
application using this, I recieve the following error:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Parser Error
Description: An error occurred during the parsing of a resource required to
service this request. Please review the following specific parse error
details and modify your source file appropriately.
Parser Error Message: The server tag is not well formed.
I tried to be careful using the single and double quotes, but I think
everything is correct. Did I do something wrong in this server tag? All my
other DataBinding Expressions work fine when I remove this tag, and the
error says the problem is in this line, so what's the problem? Thanks.
--
Nathan Sokalski
njsokalski@hotmail.com
http://www.nathansokalski.com/ Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140723
Error: data truncated.
Hello,
When writing a text to a SQL database nvarchar(6) field, I get following
error when the size of the input is larger than the available length of the
textfield (larger than 6).
String or binary data would be truncated.
The statement has been terminated.
How can I make that at least the first 6 characters will be saved and the
input is indeed truncated without generating an error or at least to catch
the error silently?
Many thanks and greetings,
Michel Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140719
Typed Dataset: Add expression-based column?
Hi, I'm creating a typed dataset based off of a SQL Server 2005 DB. There are
2 fields from one table that I'd like to bind to on an ASP.NET dropdownlist.
Since I can't specify two fields in the "Datatextfield" proprety of the
control, I'm trying to create an expression-based column. One thing that
compilicates things a bit is that one of the fields is actually a number
which points to a friendly display value in a different table. There's a
foreign-key relationship that the dataset designer (and SQL Server 2005) are
both aware of. So I can modify the query that my method uses to include the
proper text value from the other table. However, when I try to, in the query,
create a single field that combines that text field and the other field (a
datetime field), I get an error at runtime complaining of a problem
converting between a datetime and a character string:
"Conversion failed when converting datetime from character string"
Line 1329: this.Adapter.SelectCommand.Parameters[0].Value =
((int)(OwnerOfShoes));
Line 1330: DataSet1.ShoeInstancesDataTable dataTable = new
DataSet1.ShoeInstancesDataTable();
Line 1331: this.Adapter.Fill(dataTable);
Line 1332: return dataTable;
Line 1333: }
Should I be trying to architect a solution to this in the SQL query? I'd
really like to try to modify the datatable after the SQL query is complete,
but it gets a bit more complicated because one of the values needs to be
looked up in a related table. I'm not sure where I would add the code. Would
I use a partial class to add a new method?
Any thoughts on this? Any suggestions for the best way to do this?
Thanks.
-Ben Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140715
Using a .net Custom Data Provider and SQL Server 2005 Management Studio
Hi,
MS have exposed the functionality to use custom data providers in
Visual Studio 2005, I've used this and it works fine.
I would like to know if it's possible to use a custom data provider
from SSMS? I'm not even sure if SSMS uses a .net data provider under
the covers, - does anyone know?
If it does then does anyone know how SSMS gets a list of databases
from the connected instance?
Background:
We have a specialised solution which manages lots (1000's) of simple
databases (for example a questionaire) for clients built on top of SQL
2005. Each of these databases is a virtual database - they arn't real
databases in SQL 2005. The data for all the databases is stored
vertically in an EAV format in various tables. For convenience I use
my custom data provider to execute SQL against the flattened schema,
and it internally converts the sql using the schema for each "virtual"
database (stored as xml in SQL 2005) to the rather complicated SQL
required to access the real underlying tables.
Best Regards,
Daniel Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140706
what's the best approach to follow for sql execute
Hi There,
What's the better way to follow when we use sql
string sql = "Inset into table(f1,f2) values (@f1, @f2)";
then add and passing parameters or in the first place itselef assign the
values to the string
string sql = "Inset into table(f1,f2) values (" + tbName.text + ", " +
tbCity.Text +");";
Thanks
Ganesh Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140698
Change connectionstring Typed dataset
Hi,
I've noticed that if I change my connectionstring in the app.config file,
this isn't enough, a second change in the Global.System.Configuration is
necesary!!!
This means that after deployment and if the SQL server is changed, changing
the code is necesary, ..............?.??
can I prevent this?? HOW???
Thx
--
Best regards
Luc N Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140697
What does DataSet.AcceptChanges do?
If I delete rows in a DataTable and then do a DataSet.AcceptChanges, and
then pass that DataSet to the client, will the client have any idea of rows
that previously existed? I'm hoping not.
If the client would still see those rows (but as deleted), I guess I will
have to create a new DataTable and just add new rows that I want the client
to see and pass that instead?
Thanks,
Ron Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140691
Compare two DataSets?
Is there a way I can compare two DataSets to see if they are identical?
Thanks,
Ron Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140689
bind variables oracle visual basic
I have a query that looks up the highest value for column a and then
returns column a and column b. It uses a nested select in the from
clause. I want to use bind variables for my parameters but have found
out i can't use bind variables in the from clause. It keeps returning
no records when i can run this same query in toad and it returns
records. My question is can anyone help me wiht how to do this? Here
is my code:
Dim con As New OracleConnection(cnCICString)
Dim cmd As New OracleCommand
Dim da As OracleDataAdapter = New OracleDataAdapter(cmd)
con.Open()
cmd.Connection = con
cmd.CommandType = CommandType.Text
cmd.CommandText = "select ec.ec_export_number,ec_date from
event_campaign ec, " & _
" (select max(ec_export_number) as maxexport from
event_campaign" & _
" where EC_PURPOSE = :event_purpose AND EC_ITEM_SENT
= :item_sent" & _
" and EC_SQL = :sql_totalcount ) maxresults where " & _
" ec.ec_export_number = maxresults.maxexport and EC_PURPOSE
= :event_purpose AND EC_ITEM_SENT = :item_sent " & _
" and EC_SQL = :sql_totalcount"
cmd.Parameters.Add(":sql_totalcount", OracleDbType.Varchar2).Value =
"select cli_rid from dual"
cmd.Parameters.Add(":event_purpose",
OracleDbType.Varchar2).Value = "20070511TXAM"
cmd.Parameters.Add(":item_sent", OracleDbType.Varchar2).Value
= "POSTCARD" Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140687
It's back - the timeout problem
Hi;
One of our testers is getting this now - and he is not running under a
debugger. The error is:
Exception(s):DataSourceException: executeQuery select=select CategoryName
from Categories Timeout expired. The timeout period elapsed prior to
completion of the operation or the server is not responding.
It occurs randomly. And it returns this in under a second so it's unlikely
to be an actual timeout. Also this is hitting Sql Server 2005 Express on the
user's computer so it can't be a network issue.
Any idea what this can be? This code is called when clicking a button in our
program which then runs the exact same code each time. This happens
occasionally and when it does sometimes it happens again the next 2 or 3
times we click the button and then it's gone and everything is working.
--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com
Cubicle Wars - http://www.windwardreports.com/film.htm Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140685
Updated Primary Key (Identity) Value
To start, I'm using VB 2005 and SQL Server Express 2005.
This almost appears to be a bug, but I've yet to find an actual bug and
generally narrow my issues down to user-error on my part. I have the
following code snippet (LogFile is a class I've created simply to output to
a textfile):
---
Dim ta As New mattersTableAdapter
Dim dt As New mattersDataTable
Dim dr As mattersRow
LogFile.WriteLine("Adding new matter...")
'Fill data table
ta.Fill(dt)
'Add new data row and update
dr = dt.NewmattersRow
dr.Item("file_no") = "New Matter"
dr.Item("date_created") = Now
dr.Item("date_modified") = Now
dt.AddmattersRow(dr)
ta.Update(dt)
dt.AcceptChanges()
LogFile.WriteLine("New matter added. Id: {0}.",
dr.Item("m_id").ToString)
---
As you can probably already tell I'm using a Strongly Typed Dataset. The
table schema includes "m_id" being the Primary Key and has the property
"Identity Specification" set to Yes and increments by 1.
My issue is that if the DataTable is empty after being filled from the
database (ie: the database table is empty) I get 0 (zero) returned to "m_id"
in the DataRow. If the DataTable already contains existing records and I run
this code, I get the appropriate, incremented value.
Is there something I'm missing?
Thanks in advance for any help...
Luke Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140681
Help - why does SqlException not list Procedure name on timeout?
When I have a timeout on invoking a stored procedure against SQL
Server, I have an exception returned that looks like the following:
{System.Data.SqlClient.SqlException}
System.SystemException: {"Timeout expired. The timeout period
elapsed prior to completion of the operation or the server is not
responding."}
_errors: {System.Data.SqlClient.SqlErrorCollection}
Class: 10
Errors: {System.Data.SqlClient.SqlErrorCollection}
LineNumber: 0
Message: "Timeout expired. The timeout period elapsed prior to
completion of the operation or the server is not responding."
Number: -2
Procedure: "ConnectionRead (WrapperRead())."
Server: ""
Source: ".Net SqlClient Data Provider"
State: 0
There no additional information in the Errors collection. The
description of SqlException.Procedure property is as follows:
Gets the name of the stored procedure or remote procedure call (RPC)
that generated the error.
Is there something I'm missing? I'm trying to put together some
generic logging capabilities, and I had expected that the SqlException
would always provide the name of the stored procedure in the Procedure
property.
Thanks in advance. Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140679
LDAP: User associate to computer
Hi,
How to search the user (or users) associate to computer by ldap.
thanks
--
Jean-Yves BURLOT
SI - EVEN Lait Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140678
Command parameters, DBNull and SQL Server image field
Hi!
This code (using the System.Data.SqlClient namespace)...
SqlCommand c = myConnection.CreateCommand();
c.CommandText = "INSERT INTO myTable (myField) VALUES (@myParameter)";
c.Parameters.Add("@myParameter", myValue);
c.ExecuteNonQuery();
...usually works perfectly fine for all kinds of myFields and all
kinds of myValues, UNLESS
- myField is of (SQL Server) data type "image" AND
- myValue is DBNull.Value
In that case I get an SQL Server error message stating that nvarchar
is incompatible with image ("Operandentypkollision: nvarchar ist
inkompatibel mit image").
I think I understand what is happening behind the scenes: ADO.NET
cannot infer a useful data type from DBNull.Value so it assumes that
it's an nvarchar, which supports implicit conversion into a lot of
other data types, excluding (unfortunately) image.
Is there an easy solution to this problem? I need this for a library
function, i.e. the data type of myField is not known at run-time. Of
course, I could string-replace @myParameter with NULL if myValue is
DBNull.Value but that seems like a rather ugly workaround to me...
Greetings,
Heinzi
PS: I'm using .net 1.0/1.1. Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140667
Responding to DataGrid selection
With a .Net 2's WinForms which contain
1) a DataGrid which is assigned to a DataSet's DataTable (some columns are
"hidden" on screen)
2) a few TextBox which are aligned to different fields within the same
DataTable
What event do I code for the .Net DataGrid such that the TextBoxes's value
are updated as different rows are selected? Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140666
update db ?
I am having an issue with getting my ds to update my db. I am pulling info
from the NW db on my Default.aspx page. I then click the edit btn and pass
the data to my Details.aspx page. That works fine. The issue is getting the
ds to actually update the db. I know this is simple, but I can't seem to
figure out what I am doing wrong.
Here is the code... please don't laugh to hard, as this is the first time
that I have tried to do this with code-behind, I normally just use a SqlDS on
the page, but want to make the page look cleaner...
Protected Sub dvDetails_ItemUpdating(ByVal sender As Object, ByVal e As
DetailsViewUpdateEventArgs) Handles dvDetails.ItemUpdating
Dim connStr As String =
ConfigurationManager.ConnectionStrings("NWConnectionString").ToString()
Dim conn As New SqlConnection(connStr)
'Dim strSql As String = "SELECT * FROM Employees WHERE
EmployeeID=@EmployeeID"
Dim upSql As String = "UPDATE Employees SET LastName=@LastName,
FirstName=@FirstName, Title=@Title, Address=@Address," & _
"City=@City, Region=@Region, PostalCode=@PostalCode,
HireDate=@HireDate WHERE EmployeeID=@EmployeeID"
Dim da As New SqlDataAdapter
Dim ds As New DataSet
Dim ds1 As New DataSet
Dim upCmd As New SqlCommand(upSql, conn)
Dim idParam As SqlParameter = upCmd.Parameters.Add("@EmployeeID",
SqlDbType.Int, 4, "EmployeeID")
Try
' da.SelectCommand = New SqlCommand(strSql, conn)
'da.Fill(ds, "Employees")
upCmd.Parameters.Add("@LastName", SqlDbType.VarChar, 20,
"LastName")
upCmd.Parameters.Add("@FirstName", SqlDbType.VarChar, 10,
"FirstName")
upCmd.Parameters.Add("@Title", SqlDbType.VarChar, 30, "Title")
upCmd.Parameters.Add("@Address", SqlDbType.VarChar, 60, "Address")
upCmd.Parameters.Add("@City", SqlDbType.VarChar, 15, "City")
upCmd.Parameters.Add("@Region", SqlDbType.VarChar, 15, "Region")
upCmd.Parameters.Add("@PostalCode", SqlDbType.VarChar, 10,
"PostalCode")
upCmd.Parameters.Add("@HireDate", SqlDbType.DateTime, 8,
"HireDate")
idParam.SourceVersion = DataRowVersion.Original
conn.Open()
'Update Employees Table
ds1 = ds.GetChanges(DataRowState.Modified)
da.Update(ds1)
ds.Merge(ds1, False, MissingSchemaAction.Add)
ds.AcceptChanges()
dvDetails.DataBind()
Catch ex As Exception
'Display Error
Console.WriteLine("Error: " & ex.ToString())
Finally
'Close Connection
conn.Close()
'Redirect to Home
Response.Redirect("~/Default.aspx")
End Try
End Sub
As this is for learning purposes only, if you could please let me know what
needs to be changed and the format of the actual update that would be great.
I want to start using this on a normal basis, but really want to understand
it before putting it into a live app.
Thanks Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140651
Indexing usefull or not??
Maybe a stupid one,......
is it still usefull to make indexes on the SQL server since in ADO.NET we
work with complete datasets which contain complete or parts of tables???
--
Best regards
Luc N Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140650
Problems in loading data from an access database into an array
Please i'm new in VB.net and i'm designing a Cinema booking and purchase
system..I need to load the seat ID from the database into an array.please
how do i go about it.. or can anyone give me an idea of how i can show seats
are availabele,booked or bought..i'll really appreciate input....
regards
wale fabiyi
Kuala Lumpur,Malaysia Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140644
Requesting some help
Hello community
I am scincerley asking for some help. I'm 31 years old and live in the UK,
I'm married with two children and have worked all my life as has my wife.
I have been given an opportunity to emigrate to Canada and start a life long
ambition in my chosen career I have a problem though. We cannot raise the
money to move and have no deposit for a home, without this we cannot go.
Its a long shot but all I ask is if someone out there would be kind enough
to give my family a £1 donation.
I don't know if what I'm doing is allowed but if nobody wants to give then
there is no harm in asking
If your happy to help then email at d2801@yahoo.com and 'll send you my
details
Kind regards Dave Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140643
Merge DataRow Items?
I have a DataTable with one row and I did a Merge() from another
DataTable and now I have two rows. How can I get the rows to be a
single row (assuming row 0 is the "dominant" one).
Thanks. Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140642
Null value Check in DataTable?
I have a DataRow in a DataTable. I want to know if there is a value. I
do this
if ( this.Rows[0]["Col_A"] == null )
{
throw new Exception ( "no" );
}
However this condition is never hit. Why?
Thanks. Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140640
DataAdapter.Update() returns error.
Hi,
I am populating a dataset from a stored procedure, which returns
multiple resultsets. One of the resultset is formed with a join
condition from two tables. I am updating the fields of the
respective
datatable. Then update the first table in the database using
DataAdapter.Update(). This succeeds. Subsequently, I update the
fields of the second table in the datatable and update the
respective(second) table in the database using DataAdapter.Update().
This throws the error, "Concurrency violation: the UpdateCommand
affected 0 of the expected 1 records.". Dataset.HasChanges() returns
true before each update. I give below the code.
// First Table
DataRow dr = dtOrderInfo.Rows[iSelectedRow];
dr.BeginEdit();
// Data Row changes.
...
...
dr.EndEdit();
// connect to database and execute as follows.
cnDatabaseOpen(strdbconnect);
SqlDataAdapter da = new SqlDataAdapter("Select top 0 * from
OrderDetail", cnDatabase);
SqlCommandBuilder scb = new SqlCommandBuilder(da);
da.Update(dtOrderInfo);
da.Dispose();
cnDatabaseClose();
// Second Table
dr = null;
dr = dtOrderInfo.Rows[iSelectedRow];
dr.BeginEdit();
// Data Row changes.
...
...
dr.EndEdit();
// connect to database and execute as follows.
cnDatabaseOpen(strdbconnect);
SqlDataAdapter da = new SqlDataAdapter("Select top 0 * from Orders",
cnDatabase);
SqlCommandBuilder scb = new SqlCommandBuilder(da);
// Following line throws error.
da.Update(dtOrderInfo);
da.Dispose();
cnDatabaseClose();
I get the error in da.Update() for the second table.
Any help would be greatly appreciated.
Thanks
Manohar Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140639
Unexplained entry in Oledb Excel schema table
Hi
I have an excel workbook with 4 worksheets. When I connect to this workbook
using an Oledb connection, I use GetOleDbTableSchema to retrieve the names of
the worksheets ("TABLE_NAME"), only the schema table returns 5 rows, not 4.
If my worksheet names are Sheet1, Sheet2, Sheet3 and Sheet4, I would expect
to get 4 rows in the schema datatable, with "TABLE_NAME" as Sheet1$, Sheet2$,
Sheet3$ and Sheet4$, however, I get those four, and an extra one, say
Sheet1$_
Has anyone come across this before who could offer either an explanation, or
a solution, or preferably both?
Thanks in advance for your help. Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140632
How to get the primary key
Hello there,
I want to write a function returning the primary key name of a certain
table.
The following function successfully returns the names of all fields of
a table:
public string[] GetFieldNames(string tableName)
{
string[] fieldNames = null;
IDbConnection conn = _factory.CreateConnection(true);
try
{
string[] restrictions = { null, tableName, null };
DataTable dataTable = (conn as
DbConnection).GetSchema("Columns", restrictions);
if (dataTable != null)
{
fieldNames = new string[dataTable.Rows.Count];
for (int i = 0; i < dataTable.Rows.Count; i++)
fieldNames[i] = dataTable.Rows[i]
["COLUMN_NAME"].ToString();
}
return fieldNames;
}
finally
{
conn.Close();
}
}
An interesting part in the upper function is, that the table name is
at the second position in the restrictions array instead on the third,
as I have seen several times in samples found in the internet. In my
case I get the field names with the table name at the second position
in the array.
Now I wrote a function to get the primary key of a table:
public string GetPrimaryKeyName(string tableName)
{
IDbConnection conn = _factory.CreateConnection(true);
try
{
string[] restrictions = { null, tableName,
tableName };
DataTable dataTable = (conn as
DbConnection).GetSchema("PrimaryKeys", restrictions);
if (dataTable != null)
{
if (dataTable.Rows.Count > 0)
return dataTable.Rows[0]
["COLUMN_NAME"].ToString();
}
return null;
}
finally
{
conn.Close();
}
}
That function never returns me the primary key, regardless on which
position the table name is in the restrictions array. I heard that the
upper function does not work for connections based on Oracle. Is that
true?
Regards,
Norbert Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140630
How to get the last created or modified dataset
Hello,
is there a possibility to get the ID of the last created or modified
dataset of a table via ADO.NET? Is there a database independent way?
In SQL Server you can call the scope_identity() function, but this
won't work in Oracle, MySQL, Access a.s.o.
Thanks in advance,
Norbert Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140628
TransactionScope promotion & isolation levels
Our project is using the System.Transactions.TransactionScope class to
provide an ambient transaction which our DAL classes can leverage.
I'm looking for some information about the TransactionScope class to answer
a few questions about how it behaves when a transaction is promoted to a
distributed transaction.
Our environment is ASP.NETv2 on Win2003 calling db server running SQL2005.
In pseudo-code, we do something like this:
Using (scope1 = New TransactionScope())
DalA.IssueInsertAndUpdateStatementsToDb1()
Using (scope2 = New TransactionScope(TransactionScopeOptions.Suppress))
DalB.IssueInsertToDb2()
scope2.Complete()
End Using
scope1.Complete()
End Using
The first TransactionScope is used to create a transaction for a series of
DAL inserts and updates to our primary database. Then we start a second,
nested scope with the transaction option set to "Suppress" and it is used to
insert a record into a second database (on the same db server).
Both databases are configured for a default isolation level of
ReadCommitted, but we are seeing some transactions come across at the
Serializable isolation level.
My question is: is the Serializable isolation level being caused by the use
of TransactionScope (and its implicit use of DTC)?
If we were to provide the appropriate TransactionOption class to the
constructor of each scope object, would it provide us with ReadCommitted
isolation level, or does the use of DTC always force the use of Serializable?
Thanks,
Chris Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140627
DataReader values and .ToString
Hello,
In order to avoid errors, I have all my DataReader-fields converted with a
.ToString.
This in case some record could have Null-fields and an error would be
thrown.
This works fine, except for "money" fields in SQL-Server.
When I enter e.g. ? 2,50 and I read it back with a DataReader without
.ToString, I get the correct display.
However using .ToString, I get no valuta-sign and the value is multiplied by
10 000.
When trying to StringFormat the DataReader.ToString, I get a syntax error.
Can someone explain this to me an offer some help?
Many thanks and greetings,
Michel Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140619
SqlDependency.Start KeyNotFoundException - Possible Bug
I'm working heavily with query notifications in SQL Server 2005 and I'm now
getting the following exception:
System.Collections.Generic.KeyNotFoundException: The given key was not
present in the dictionary.
This was working for quite a while and then it stopped. At first, the
exception was intermittent, but now it's permanent. The exception is
happening deep inside of a System.Data.dll in a class called
SqlDependencyProcessDispatcher in a method defined as follows:
private bool Start(string connectionString, out string server, out
DbConnectionPoolIdentity identity, out string user, out string database, ref
string queueService, string appDomainKey, SqlDependencyPerAppDomainDispatcher
dispatcher, out bool errorOccurred, out bool appDomainStart, bool useDefaults)
It looks like the method is checking a dictionary for particular key; then,
if it's found, it retrieves the item from the dictionary. Looking at
Reflector it appears that this lookup may not be threadsafe. It has a few
code blocks inside structured like this:
if (!this._sqlDependencyPerAppDomainDispatchers.ContainsKey(appDomainKey))
{
lock (this._sqlDependencyPerAppDomainDispatchers)
{
this._sqlDependencyPerAppDomainDispatchers[appDomainKey] =
dispatcher;
}
}
These should probably be using
sqlDependencyPerAppDomainDispatchers.TryGetValue instead or should move the
lock to the outside of the if statement.
No one on the Internet seems to have ever encountered this.
Two partial stack traces appear below. They're partial in that I've
ommitted a
long set of calls from our interal app framework that are orthogonal to the
problem.
The NT user making these calls is a local administrator on the database
server. The calls work a lot of the time, but break and seemingly random
moments.
We use a preconfigured SQL Server Service Broker Queue named
QueryChangeMessages and a service called QueryChangeNotifications.
Please help.
One stack trace looks like this:
[KeyNotFoundException: The given key was not present in the dictionary.]
SqlDependencyProcessDispatcher.Start(String connectionString, String
queue, String appDomainKey, SqlDependencyPerAppDomainDispatcher dispatcher) +0
System.Data.SqlClient.SqlDependency.Start(String connectionString, String
queue, Boolean useDefaults) +672
System.Data.SqlClient.SqlDependency.Start(String connectionString, String
queue) +7
Nvidia.PolicyInjection.CallHandlers.SqlDependencyConnection.StartInternal()
+103
[DataException: An error occurred while calling
ConfigurationManagement.Start for connection string named
ConfigurationManagement on SQL Server Service Broker Queue
QueryNotificationQueue.]
...
Another stack trace looks like this:
Server stack trace:
at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at
SqlDependencyProcessDispatcher.SqlConnectionContainer.ProcessNotificationResults(SqlDataReader reader)
at
SqlDependencyProcessDispatcher.SqlConnectionContainer.SynchronouslyQueryServiceBrokerQueue()
at
SqlDependencyProcessDispatcher.SqlConnectionContainer..ctor(SqlConnectionContainerHashHelper hashHelper, String appDomainKey, Boolean useDefaults)
at SqlDependencyProcessDispatcher.Start(String connectionString, String&
server, DbConnectionPoolIdentity& identity, String& user, String& database,
String& queueService, String appDomainKey,
SqlDependencyPerAppDomainDispatcher dispatcher, Boolean& errorOccurred,
Boolean& appDomainStart, Boolean useDefaults)
at SqlDependencyProcessDispatcher.Start(String connectionString, String
queue, String appDomainKey, SqlDependencyPerAppDomainDispatcher dispatcher)
at
System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr
md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext,
Object[]& outArgs)
at
System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle
md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext,
Object[]& outArgs)
at
System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage
reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
msgData, Int32 type)
at SqlDependencyProcessDispatcher.Start(String connectionString, String
queue, String appDomainKey, SqlDependencyPerAppDomainDispatcher dispatcher)
at System.Data.SqlClient.SqlDependency.Start(String connectionString,
String queue, Boolean useDefaults)
at System.Data.SqlClient.SqlDependency.Start(String connectionString,
String queue)
... Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140613
SqlDependency.Start - Getting KeyNotFoundException
I'm working heavily with query notifications in SQL Server 2005 and I
get the following exception:
System.Collections.Generic.KeyNotFoundException: The given key was
not
present in the dictionary.
This was working and then it stopped. At first, the exception was
intermittent, but now it's permanent. The exception is happening deep
inside of a System.Data.dll in a class called
SqlDependencyProcessDispatcher in a method defined as follows:
private bool Start(string connectionString, out string server, out
DbConnectionPoolIdentity identity, out string user, out string
database, ref string queueService, string appDomainKey,
SqlDependencyPerAppDomainDispatcher dispatcher, out bool
errorOccurred, out bool appDomainStart, bool useDefaults)
It looks like the method is checking a dictionary for particular key;
then, if it's found, it retrieves the item from the dictionary.
Looking at Reflector it appears that this lookup may not be
threadsafe. It has a few code blocks inside structured like this:
if (!
this._sqlDependencyPerAppDomainDispatchers.ContainsKey(appDomainKey))
{
lock (this._sqlDependencyPerAppDomainDispatchers)
{
this._sqlDependencyPerAppDomainDispatchers[appDomainKey] = dispatcher;
}
}
These should probably be using
sqlDependencyPerAppDomainDispatchers.TryGetValue instead or should
move the lock to the outside of the if statement.
No one on the Internet seems to have ever encountered this.
Two partial stack traces appear below. They're partial in that I've
ommitted a
long set of calls from our interal app framework that are orthogonal
to the
problem.
The NT user making these calls is a local administrator on the
database
server. The calls work a lot of the time, but break and seemingly
random
moments.
We use a preconfigured SQL Server Service Broker Queue named
QueryChangeMessages and a service called QueryChangeNotifications.
Please help.
One stack trace looks like this:
[KeyNotFoundException: The given key was not present in the
dictionary.]
SqlDependencyProcessDispatcher.Start(String connectionString,
String queue, String appDomainKey, SqlDependencyPerAppDomainDispatcher
dispatcher) +0
System.Data.SqlClient.SqlDependency.Start(String connectionString,
String queue, Boolean useDefaults) +672
System.Data.SqlClient.SqlDependency.Start(String connectionString,
String queue) +7
Nvidia.PolicyInjection.CallHandlers.SqlDependencyConnection.StartInternal()
+103
[DataException: An error occurred while calling
ConfigurationManagement.Start for connection string named
ConfigurationManagement on SQL Server Service Broker Queue
QueryNotificationQueue.]
...
Another stack trace looks like this:
Server stack trace:
at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at
SqlDependencyProcessDispatcher.SqlConnectionContainer.ProcessNotificationResults(SqlDataReader
reader)
at
SqlDependencyProcessDispatcher.SqlConnectionContainer.SynchronouslyQueryServiceBrokerQueue()
at
SqlDependencyProcessDispatcher.SqlConnectionContainer..ctor(SqlConnectionContainerHashHelper
hashHelper, String appDomainKey, Boolean useDefaults)
at SqlDependencyProcessDispatcher.Start(String connectionString,
String&
server, DbConnectionPoolIdentity& identity, String& user, String&
database,
String& queueService, String appDomainKey,
SqlDependencyPerAppDomainDispatcher dispatcher, Boolean&
errorOccurred,
Boolean& appDomainStart, Boolean useDefaults)
at SqlDependencyProcessDispatcher.Start(String connectionString,
String
queue, String appDomainKey, SqlDependencyPerAppDomainDispatcher
dispatcher)
at
System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr
md, Object[] args, Object server, Int32 methodPtr, Boolean
fExecuteInContext,
Object[]& outArgs)
at
System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle
md, Object[] args, Object server, Int32 methodPtr, Boolean
fExecuteInContext,
Object[]& outArgs)
at
System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage
msg, Int32 methodPtr, Boolean fExecuteInContext)
Exception rethrown at [0]:
at
System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage
reqMsg, IMessage retMsg)
at
System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
msgData, Int32 type)
at SqlDependencyProcessDispatcher.Start(String connectionString,
String
queue, String appDomainKey, SqlDependencyPerAppDomainDispatcher
dispatcher)
at System.Data.SqlClient.SqlDependency.Start(String
connectionString,
String queue, Boolean useDefaults)
at System.Data.SqlClient.SqlDependency.Start(String
connectionString,
String queue)
... Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140612
GridView databinding
I have a GridView which is bound to a table. The user has the ability to
change some defaults and then run a process from this.
This all worked fine until I added in an auto postback to one of the
controls to tie in some other functionality.
After the post back, and at the end of page load complete, everything is as
it should be, but then the GridView does an automatic databind (after load
complete) and wipes it all out. Is there anyway to keep this automatic
update from occuring, or cancel it or whatever?
Thanks. Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140609
Database Persistance
Hi
I'm not sure whether I've given this post the correct title, but I'm a
bit unsure of where to put it.
I have a database that holds information about several of our users.
This database is stored on a central server, with an application that
periodically performs some processing, which may or may not update the
database. It is possible that some times this data will update several
times a minute.
Here's my problem - I would like to create an application, in a remote
location to the main database server that displays the database
contents. This applications would need to update its view of the
database as soon as the database changes in order to ensure that only
the most up to date information is being displayed.
I've previously done this by periodically re-reading the database and
updating the fields that have changed on screen, however as I add more
terminals, this may cause a problem. So ideally I would like a
callback or trigger to be called when the database updates that
informs the correct client, so that it can update it's screen
accordingly.
Is this possible, or am I barking up the wrong tree? Is there a better
way of doing it? I'd be very grateful if you could give me your
thoughts.
I am developing the main client application in C#, and the database is
currently MySQL. It would be possible to change the database if this
made things easier, however it would have to be a free alternative!
Many thanks
Steve Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140601
Detach database from SQL Server
Hello,
When I have closed my appliciation in VB.NET, and I try to detach my
database from SQL SERVER, I often get a message that the database cannot be
detachted, because it is still in use.
So I think there is some code missing in my application (in the
MDI_FormClosing?)
to make my database is no longer in use.
I already put a Connection.Close in the FormClosing also in a Finally-block
of
that FormClosing, but that does not seem to be enough.
Can someone help me with that?
Many thanks and greetings,
Michel Tag: Is it possible to get the leftmost tab name of a Excel file? Tag: 140599
Is it possible to get the leftmost tab name of a Excel file using ado.net?