| What are some ADO & ASP.NET best practices |
|
 |
Index ‹ DotNet ‹ ADO
|
- Previous
- 1
- Winforms >> vbnet Checkbox true or falseHi
How to databanding checkbox in windowsform
code below does not work
Me.txtFax.DataBindings.Add("text", bsAdressen, "Fax") 'Works fine
Me.txtEmail.DataBindings.Add("text", bsAdressen, "Email") 'Works fine
Me.chkKlant.DataBindings.Add("Checked", bsAdressen, "Klant") 'does not work
Data from mssql server 2005 i try data type bit and tinyint
Many thanks
Scotty
- 2
- Visual C#.Net >> MDI Events From MDIChildHi.. Is there a proper way to monitor Parent events from a mdi child?
Example: User resizes parent, I'd like a mdi child to react to that
mdi parent resize event. Thanks for any help
John
- 3
- Visual C#.Net >> trimming stringsHi, I have " 'anyword' ", and i want to trim out the '. Ive tried
using:
string test = " 'anyword' ".
char[] DeleteChars = { ''' };
string id = test.Trim(DeleteChars) and string id = test.Trim(''') .
These didnt work. Any ideas please.
Regards Robert
- 4
- Visual C#.Net >> How to Avtivate a child window in Dragging a MouseI'm looking for a way to activate, give focus to the child window in
the Multiple Document Interface environment while it is being or
rather just before it is being dragged.
I have used _DragOver and _DragEnter with a this.Activate code.
However the only result I get is that the child window will be
dragged, often beneath another window before being activated when the
mouse dragging action has ended and athe button is released.
Is there a way to activate this child window right at the beginning of
the dragging motion ? So that it does not disappear beneath another
child window ?
Thanks
*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*
- 5
- Visual C#.Net >> Setup projects: do dlls get registered during installation???Hi!
I just wanted to ask about the dlls that we add to the=
application folder using the setup projects, are they registered=
on installation and if yes why=2E The reason that i ask this is=
that my project required mfc70=2Edll for it to work, i added=
mfc70=2Edll in the application folder and now when i install the=
application using the installer, there is an error saying:
"Module C:\=2E=2E=2E=2E=2E=2E\mfc70=2Edll failed to register HRESULT=
-2147024769 Contact your support personnel" and it gives me 3=
options, "Exit installation", "try again" or "continue=2E"
Please help me out here=2E
Thanks=2E
--------------------------------
From: Samir Azmat
-----------------------
Posted by a user from =2ENET 247 (http://www=2Edotnet247=2Ecom/)
<Id>KjpAMOjOX06R/OlAzCccVQ=3D=3D</Id>
- 6
- Microsoft Project >> Compare Project Versions error '1101'I am using Project Professional 2003. I am constantly getting the same errors
when trying to compare project versions.
First error:
- Title: Compare Project Versions Utility
- Message: Run-time error '1101'. The argument value is not valid.
- OK
Then second error:
- Title: Error!
- Message: An error occurred in the COM Add-in named: Compare Project
Versions. Error #:440. Automation error. Please restart Microsoft Office
Project to restart the COM Add-in.
I am getting these errors in the same sequence all the time. When I working
with project localy and when connected to the Project Server. On my own
computer and on my colleque PC. With different Project files containing just
few sample tasks.
I have never succeeded in my attempt to run this Compare Project Versions
utility.
Could anybody suggest me any ideas?
Brgds, Saulius
- 7
- Dotnet >> Finding which control triggers the Lost focusI have a situation wherein i have a text box, that has abc()[a validation
method that leaves the focus on the same control if not validated] being
executed whenever the lost focus event is triggered. However, there is an
exceptional case where, if a button click causes the lost focus, I do not
want abc() to be called. Is there a method by which one can find out which
control is triggering the lost focus event?
I have a keyboard shortcut for the click handle, and the lost focus handle
does not get invoked if I use the shortcut. However, when I try the mouse to
click on the button, the lost focus is gettin triggered.
Any thoughts?
Cheers!
Nicj
- 8
- Visual C#.Net >> Propertygird and multiline itemsHi!
Is there a way to display text in Propertygrid that spreads in to multiple
lines?
I don´t want to make editor that opens a new dialog when user is editing
value - i would like to have normal Textbox with several lines. I know i
need to inherit from UITypeEditor, but how do i implement the overloaded
PaintValue- and EditValue-methods. And how do i tell my grid that this line
is taller than the others.
thx
Kimmo Laine
- 9
- Dotnet >> Popup appears " Installing COM Components" on Opening of MS Excelhi
I have faced with a problem whenever i run MS-Excel, a dialog appears
with a title "Installing COM Component" and displaying an IP i.e.
207.46.249.55. Progress bar never ends however cancel button is
provided to cancel the process. Why this happens and how can i get rid
of this problem.
Thanks & Regards
Imi
- 10
- Microsoft Project >> Newbeeeeeee QuestionDear All,
Plz excuse my ignorance, but we were all one ignorant, right?
Anyway I have learned to setup my tasks etc. WHat I would like to do is the
following:
Accourding to the plan my project will be completed on Jan 24. Now of cource
this is true if everything goes as planned. However today my working time
was interupted and I only got half of my work in. How can I see how this
adjusts the final outcome of the project.
In other words I want to enter how much I worked today (and tomorow and so
on) and have project screem at me: "look if this is what you did your
project will be completed on XYZ"
Thank you
Susan
- 11
- Dotnet >> insert with stored procedure - no errors, but no insertI am trying to use a stored procedure to insert a record using VS 2005, VB
and SQL Server Express. The code runs without errors or exceptions, and
returns the new identifer in the output parameters. It returns my error text
message in another output parameter as "ok", which is the value that is set
in the stored procedure prior to doing the insert. It returns my var for
@@rowcount as 1. However, the record does not get into the table.
Even after creating the parameters the long way, it still does not work. I
hope someone can help -- thank you.
Sandy
VB code:
Private Sub btnAddProject_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnAddProject.Click
Dim Picture1 As Byte()
Dim Picture2 As Byte()
Dim Picture3 As Byte()
Dim connectString As String = My.Settings.RemodelGenieConnectionString
Dim conn As New SqlClient.SqlConnection
conn.ConnectionString = connectString
conn.Open()
Dim cmd As New SqlClient.SqlCommand("dbo.usp_AddProject", conn)
Dim m As New Misc
If FileExists(txtPicture1Path.Text) Then
Picture1 = m.ReadBinary(txtPicture1Path.Text)
Else
Picture1 = Nothing
End If
If FileExists(txtPicture2Path.Text) Then
Picture2 = m.ReadBinary(txtPicture2Path.Text)
Else
Picture2 = Nothing
End If
If FileExists(txtPicture3Path.Text) Then
Picture3 = m.ReadBinary(txtPicture3Path.Text)
Else
Picture3 = Nothing
End If
cmd.CommandType = CommandType.StoredProcedure
Dim paramname As New SqlClient.SqlParameter
paramname.ParameterName = "@ProjectName"
paramname.DbType = DbType.String
paramname.Size = txtProjectName.Text.Length
paramname.Value = txtProjectName.Text.ToString
paramname = cmd.Parameters.Add(paramname)
Dim paramaddr As New SqlClient.SqlParameter
paramaddr.ParameterName = "@PropertyAddress"
paramaddr.DbType = DbType.String
paramaddr.Size = txtPropertyAddress.Text.Length
paramaddr.Value = txtPropertyAddress.Text
paramaddr = cmd.Parameters.Add(paramaddr)
Dim parambudget As New SqlClient.SqlParameter
parambudget.ParameterName = "@ProjectBudget"
parambudget.DbType = DbType.Currency
parambudget.Value = System.Convert.ToDecimal(txtProjectBudget.Text)
parambudget = cmd.Parameters.Add(parambudget)
Dim paramtype As New SqlClient.SqlParameter
paramtype.ParameterName = "@PropertyType"
paramtype.DbType = DbType.String
paramtype.Size = cmbPropertyType.Text.Length
paramtype.Value = cmbPropertyType.Text
paramtype = cmd.Parameters.Add(paramtype)
Dim parambed As New SqlClient.SqlParameter
parambed.ParameterName = "@NumberBedrooms"
parambed.DbType = DbType.Int16
parambed.Value = System.Convert.ToInt16(txtNumberBedrooms.Text)
parambed = cmd.Parameters.Add(parambed)
Dim parambath As New SqlClient.SqlParameter
parambath.ParameterName = "@NumberBathrooms"
parambath.DbType = DbType.Int16
parambath.Value = System.Convert.ToInt16(txtNumberBathrooms.Text)
parambed = cmd.Parameters.Add(parambath)
Dim paramland As New SqlClient.SqlParameter
paramland.ParameterName = "@LandSqFeet"
paramland.DbType = DbType.Double
paramland.Value = System.Convert.ToDecimal(txtLandSqFeet.Text)
paramland = cmd.Parameters.Add(paramland)
Dim paramint As New SqlClient.SqlParameter
paramint.ParameterName = "@InteriorSqFeet"
paramint.DbType = DbType.Double
paramint.Value = System.Convert.ToDecimal(txtInteriorSqFeet.Text)
paramint = cmd.Parameters.Add(paramint)
Dim paramheat As New SqlClient.SqlParameter
paramheat.ParameterName = "@Heating"
paramheat.DbType = DbType.Boolean
If chkHeating.Checked Then
paramheat.Value = True
Else
paramheat.Value = 0
End If
cmd.Parameters.Add(paramheat)
Dim paramair As New SqlClient.SqlParameter
paramair.ParameterName = "@AirConditioning"
paramair.DbType = DbType.Boolean
If chkAirConditioning.Checked Then
paramair.Value = 1
Else
paramair.Value = 0
End If
cmd.Parameters.Add(paramair)
Dim paramgarage As New SqlClient.SqlParameter
paramgarage.ParameterName = "@EnclosedGarage"
paramgarage.DbType = DbType.Boolean
If chkEnclosedGarage.Checked Then
paramgarage.Value = 1
Else
paramgarage.Value = 0
End If
cmd.Parameters.Add(paramgarage)
Dim parampool As New SqlClient.SqlParameter
parampool.ParameterName = "@Pool"
parampool.DbType = DbType.Boolean
If chkPool.Checked Then
parampool.Value = 1
Else
parampool.Value = 0
End If
cmd.Parameters.Add(parampool)
Dim paramcomments As New SqlClient.SqlParameter
paramcomments.ParameterName = "@Comments"
paramcomments.DbType = DbType.String
paramcomments.Value = txtComments.Text
paramcomments.Size = txtComments.Text.Length
paramcomments = cmd.Parameters.Add(paramcomments)
Dim parampic1 As New SqlClient.SqlParameter
parampic1.ParameterName = "@Picture1"
parampic1.DbType = DbType.Object
parampic1.IsNullable = True
If Picture1 IsNot Nothing Then
parampic1.Size = Picture1.Length
End If
parampic1.Value = Picture1
cmd.Parameters.Add(parampic1)
Dim parampic2 As New SqlClient.SqlParameter
parampic2.ParameterName = "@Picture2"
parampic2.DbType = DbType.Object
parampic2.IsNullable = True
If Picture2 IsNot Nothing Then
parampic2.Size = Picture2.Length
End If
parampic2.Value = Picture2
cmd.Parameters.Add(parampic2)
Dim parampic3 As New SqlClient.SqlParameter
parampic3.ParameterName = "@Picture3"
parampic3.DbType = DbType.Object
parampic3.IsNullable = True
If Picture3 IsNot Nothing Then
parampic3.Size = Picture3.Length
End If
parampic3.Value = Picture3
cmd.Parameters.Add(parampic3)
'parampic1 = cmd.Parameters.Add("@Picture1", SqlDbType.Image).Value
= Picture1
'Dim parampic2 As New SqlClient.SqlParameter
'parampic2 = cmd.Parameters.Add("@Picture2", SqlDbType.Image).Value
= Picture2
'Dim parampic3 As New SqlClient.SqlParameter
'parampic3 = cmd.Parameters.Add("@Picture3", SqlDbType.Image).Value
= Picture3
Dim paramid As New SqlClient.SqlParameter
paramid = cmd.Parameters.Add("@id", SqlDbType.UniqueIdentifier)
paramid.Direction = ParameterDirection.Output
Dim paramrows As New SqlClient.SqlParameter
paramrows = cmd.Parameters.Add("@rowcount_var", SqlDbType.Int)
paramrows.Direction = ParameterDirection.Output
Dim paramerr As New SqlClient.SqlParameter
paramerr = cmd.Parameters.Add("@error_text", SqlDbType.NVarChar, 255)
paramerr.Direction = ParameterDirection.Output
Dim result As Boolean
Try
result = cmd.ExecuteNonQuery()
Catch ex As SqlClient.SqlException
MsgBox(ex.Message)
End Try
MsgBox("error text = " &
cmd.Parameters("@error_text").Value.ToString & vbCr & "id = " &
cmd.Parameters("@id").Value.ToString & vbCr & "rowcount = " &
cmd.Parameters("@rowcount_var").Value.ToString)
conn.Close()
conn = Nothing
End Sub
stored procedure code:
ALTER PROCEDURE dbo.usp_AddProject
/*
(
@parameter1 int = 5,
@parameter2 datatype OUTPUT
)
*/
(
@ProjectName nvarchar(100),
@PropertyAddress nvarchar(150),
@ProjectBudget money,
@PropertyType nvarchar(50),
@NumberBedrooms smallint,
@NumberBathrooms smallint,
@LandSqFeet float,
@InteriorSqFeet float,
@Heating bit = 0,
@AirConditioning bit = 0,
@EnclosedGarage bit = 0,
@Pool bit = 0,
@Comments nvarchar(2000),
@Picture1 image = null,
@Picture2 image = null,
@Picture3 image = null,
@id uniqueidentifier = default out,
@rowcount_var int = 0 out,
@error_text nvarchar(255) ='ok' out
)
AS
/* SET NOCOUNT ON */
declare @error_var int
set @id = newid()
set @error_text = N'ok'
/* insert */
insert into Projects (ProjectId,ProjectName,
PropertyAddress,ProjectBudget,PropertyType,
NumberBedrooms,NumberBathrooms,LandSqFeet,
InteriorSqFeet,Heating,AirConditioning,EnclosedGarage,
Pool,Comments,Picture1,Picture2,Picture3) values
(@id,@Projectname,@PropertyAddress,@ProjectBudget,
@PropertyType,@NumberBedrooms,@NumberBathrooms,
@LandSqFeet,@InteriorSqFeet,@Heating,@AirConditioning,
@EnclosedGarage,@Pool,@Comments,@Picture1,@Picture2,
@Picture3)
set @error_var = @@error;
set @rowcount_var = @@rowcount;
if @error_var <> 0
begin
select @error_text = (select description from sysmessages where
error=@error_var)
end
RETURN
- 12
- Net Framework >> AppDomain and PrivateBinPathHi together,
I have got a question according to AppDomains and their PrivateBinPath
property.
I am doing the following:
------> SNIP
AppDomainSetup actSetup = new AppDomainSetup();
actSetup.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory;
actSetup.PrivateBinPath = @"Lib2;Lib1";
AppDomain firstLibDomain =
AppDomain.CreateDomain(Guid.NewGuid().ToString(),
null, actSetup);
IClassLibrary actLib = firstLibDomain.CreateInstanceAndUnwrap("MyLib,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=397a36feab9afc6a",
"ClassLibrary.Test") as IClassLibrary;
--------< SNAP
So everthing is fine. As you can see there are two subdirectories: Lib2
and
Lib1 in the private bin path. Now when I have an assembly with the
fully
qualified name like:
"MyLib, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=63f75bd8dc418e77",
"ClassLibrary.Test"
(the only difference is the public key token) in the Lib2 subdirectory
and
"MyLib, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=397a36feab9afc6a",
"ClassLibrary.Test"
in the Lib1 subdirectory. I get the following error in the fusion log.
WRN: Comparing the assembly name resulted in the mismatch: PUBLIC KEY
TOKEN
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing
terminated.
Which means that he finds the assembly name, but the public key token
doesn't match. So the loading mechnism stops here instead of looking
in the other subfolder Lib2 where the matching assembly would be.
If I put both assemblies in the GAC I didn't have any problems. So I am
wondering, I thought that I could get this running with AppDomain too?
Any ideas what's wrong here????
Cheers,
Franz
- 13
- Visual C#.Net >> Simple question about a drop down listI'm using the drop down list in a web app. I can set the items in the list
with no problem. How do I set the text? That is to say, how do I set the part
that the user sees before they drop down the list?
--
----------------------------------------
Magic is not in the hands of the magician but in the mind of the audience.
Animadverto est verus
- 14
- Visual C#.Net >> Hash from arrayHi,
I have an array of objects, lets say they are of type MyObject, which I
would
like to calculate a unique hash for. The object looks something like this
class MyObject
{
public string a;
public string b;
public string c;
public string d;
// And a few other public fields
}
What I would like to do it calculate a combined hash for all the MyObject
objects
in the array, based on the a, b, c and d fields. Suggestions on how to do
this with
a good hash implementation? I guess XOR-ing the fields together and then XOR
the results from each object wouldnt be the best of ways.
/Andreas
- 15
- Visual C#.Net >> Flickering with tab controlI have a tab control in my application, and any time I mouse over or off of a
tab, it flickers. It looks like it is redrawing it (albeit slowly) each time
one of these mouse events are raised.
I would like to eliminate this flicker, but I am not sure what might be
causing it. I noticed the HotTrack attribute in the tab control properties,
but turning it off did nothing. Infact, the tabs still visually changed with
it off (added a little orange bar on top on mouse over), but that is a
different issue I guess.
As I am really not sure where to start with this, any and all advice and
ideas are appreciated. Thanks!
|
| Author |
Message |
holyearth

|
Posted: Sun May 09 09:03:42 CDT 2004 |
Top |
ADO >> What are some ADO & ASP.NET best practices
What is the best practice for querying, inserting and deleting from a SQL
2000 database from high traffic ASP.NET web forms? Is it to have the
SqlConnection & SqlCommand object initialized and stored globally in the
Application object, or is it to dynamically create and destroy them with
every visit to the web forms? I am seeing a serious problem with
performance when I got to over 1000 users consecutively. I estimate a usage
of over 10,000.
If I am to store the SqlConnection and Command objects in the global
Application object, how will I deal with threading, or is IIS single
threaded?
How do sites like Google perform their queries? They must be in the million
hit range.
My next question is will transactions help to improve performance? And if
so, where can I find completed samples?
I know I have a lot of question and I thank you for your help in advance.
Sincerely,
- Rashad Rivera
DotNet259
|
| |
|
| |
 |
Scott

|
Posted: Sun May 09 09:03:42 CDT 2004 |
Top |
ADO >> What are some ADO & ASP.NET best practices
Hi Rashad:
Keeping connection objects around in global state will kill
scalability. Transactions are generally bad for performance, but
required for data integrity.
What is the serious problem you are encountering? The first step would
be to use tools like ACT, SQL Profiler, and Perfmon to identify where
botlenecks occur. Maybe it's a common query in your database not using
an index, or perhaps your ASP.NET has a problem and the database is
under utilized. There is a *wealth* of information in the following
document, including how to measure performance, with chapters
dedicated to ADO.NET and SQL Server performance tips:
Improving .NET Application Performance and Scalability
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag/html/scalenet.asp
HTH,
--
Scott
http://www.OdeToCode.com
On Sat, 8 May 2004 18:15:35 -0400, "Rashad Rivera"
<EMail@HideDomain.com> wrote:
>What is the best practice for querying, inserting and deleting from a SQL
>2000 database from high traffic ASP.NET web forms? Is it to have the
>SqlConnection & SqlCommand object initialized and stored globally in the
>Application object, or is it to dynamically create and destroy them with
>every visit to the web forms? I am seeing a serious problem with
>performance when I got to over 1000 users consecutively. I estimate a usage
>of over 10,000.
>
>
>
>If I am to store the SqlConnection and Command objects in the global
>Application object, how will I deal with threading, or is IIS single
>threaded?
>
>
>
>How do sites like Google perform their queries? They must be in the million
>hit range.
>
>
>
>My next question is will transactions help to improve performance? And if
>so, where can I find completed samples?
>
>
>
>I know I have a lot of question and I thank you for your help in advance.
>
>
>
>Sincerely,
>
>
>
>- Rashad Rivera
>
|
| |
|
| |
 |
Val

|
Posted: Sun May 09 15:06:51 CDT 2004 |
Top |
ADO >> What are some ADO & ASP.NET best practices
Hi,
I do not think using of the global connection is a good idea. If you think
about performance impact during opening of the connection, then .NET
provides connection pooling, which improves performance. If your application
uses same connection string each time when it opens connection to the
database, then first time connection will take some time, but subsequent
calls should take almost no time, since connection will be taken from the
pool.
You should also think about using of the stored procedures to improve
performance. Using of the .NET Managed provider for SQL Server would also
allow to improve performance
--
Val Mazur
Microsoft MVP
"Rashad Rivera" <EMail@HideDomain.com>
wrote in message news:O%EMail@HideDomain.com...
> What is the best practice for querying, inserting and deleting from a SQL
> 2000 database from high traffic ASP.NET web forms? Is it to have the
> SqlConnection & SqlCommand object initialized and stored globally in the
> Application object, or is it to dynamically create and destroy them with
> every visit to the web forms? I am seeing a serious problem with
> performance when I got to over 1000 users consecutively. I estimate a
> usage
> of over 10,000.
>
>
>
> If I am to store the SqlConnection and Command objects in the global
> Application object, how will I deal with threading, or is IIS single
> threaded?
>
>
>
> How do sites like Google perform their queries? They must be in the
> million
> hit range.
>
>
>
> My next question is will transactions help to improve performance? And if
> so, where can I find completed samples?
>
>
>
> I know I have a lot of question and I thank you for your help in advance.
>
>
>
> Sincerely,
>
>
>
> - Rashad Rivera
>
>
|
| |
|
| |
 |
| |
 |
Index ‹ DotNet ‹ ADO |
- Next
- 1
- 2
- Net Framework >> Error while sending e-mails with attachments using SmtpClient::SendAsyncError while sending e-mails with attachments using
SmtpClient::SendAsync Options
There are currently too many topics in this group that display
first. To make this topic appear first, remove this option from
another topic.
There was an error processing your request. Please try again.
Standard view View as tree
Proportional text Fixed text
1 message - Collapse all
The group you are posting to is a Usenet group. Messages posted to
this group will make your email address visible to anyone on the
Internet.
Your reply message has not been sent.
Your post was successful
mukesh bhakta View profile
More options May 14, 10:46 am
Newsgroups: microsoft.public.dotnet.framework.windowsforms
From: mukesh bhakta <mukesh_bha...@hotmail.com>
Date: 13 May 2007 17:46:04 -0700
Local: Mon, May 14 2007 10:46 am
Subject: Error while sending e-mails with attachments using
SmtpClient::SendAsync
Reply | Reply to author | Forward | Print | Individual message | Show
original | Remove | Report this message | Find messages by this
author
Hi guys,
I get an error when I send e-mails with attachments using SmtpClient.
Following is the code snippet -
MailMessage msg = new MailMessage(from, to);
/*...all the initialization goes here */
byte [] data = /* some binary data */
using (MemoryStream ms = new MemoryStream(/*att.Contents*/))
{
using (StreamWriter sw = new StreamWriter(ms))
{
sw.Write(data);
sw.Flush();
ms.Position = 0;
System.Net.Mail.Attachment natt = new
System.Net.Mail.Attachment(
ms, "test.txt");
msg.Attachments.Add(natt);
}
}
private static void sendCompletedCallback(object sender,
AsyncCompletedEventArgs e)
{
if (e.Cancelled)
{
logmsg("E-mail send cancelled");
}
else if (e.Error != null)
{
System.Diagnostics.Debug.WriteLine(e.Error.ToString());
logmsg(e.Error.Message + ' ' +
e.Error.InnerException.Message);
}
else
{
logmsg(success)
}
}
The error I am getting in the above method is -
System.Net.Mail.SmtpException: Failure sending mail. --->
System.NotSupportedException: Stream does not support reading.
at System.Net.Mime.MimeBasePart.EndSend(IAsyncResult asyncResult)
at System.Net.Mail.Message.EndSend(IAsyncResult asyncResult)
at System.Net.Mail.SmtpClient.SendMessageCallback(IAsyncResult
result)
--- End of inner exception stack trace ---
What am I doing wrong? The code seems to work fine if no attachment
is
supplied.
cheers
MB
- 3
- ADO >> Datagrid Column WidthI found the following code on microsoft.support.com which is supposed to with of a column
'----------------------------------------------
Dim ts As New DataGridTableStyle(
ts.MappingName = "tbl_Client
DataGrid1.TableStyles.Clear(
DataGrid1.TableStyles.Add(ts
DataGrid1.TableStyles("tbl_Client").GridColumnStyles("First_Name").Width = 17
'--------------------------------------------------------------------------------------
Where tbl_Client is the Table name and First_Name is the column Name
But when I run the code I get the following error
Object reference not set to an instance of an objec
Thanks for your hel
- 4
- Visual C#.Net >> How to hide a property on DataGridIs there an attribute for a property on an object that saus :"This property
is not shown on a DataGrid" ?
I know it can be done on the grid itself, using DataGridTableStyle,
DataGridColumnStyle etc. But I`d like to get the same result by changing my
class, not at run-time changing grid`s behaveiour.
A small example:
public class User
{
private string m_Uid;
private string m_Name;
private string m_Pwd;
// UID should be visible on a DataGrid
public string UID
{
get {return m_Uid;}
set {m_Uid = value;}
}
// Name should be visible on a DataGrid
public string Name
{
get {return m_Name;}
set {m_Uid = Name;}
}
// PWD should *NOT* be visible on a DataGrid
//is there an attribute for this ?
[SomeAttribute.PreventBindingToGrid(true)] // this is what I`m looking
for
public string PWD
{
get {return m_Pwd;}
set {m_Pwd = value;}
}
} // End of User.
On a form with a DataGrid - gridUsers, We implement (implementation not
shown) a method to fetch users into an ArrayList of User objects, and bind
gridUsers to the list:
ArrayList alUsers = FetchUsers();
gridUsers.DataSource = alUsers; // Currently, the grid has 3 columns,
including PWD.
Can this be done (prevent PWD property from binding) ?
TIA Boaz Ben-Porat
DataPharm a/s
Denmark
- 5
- Dotnet >> AddWatchIn VB6 I used to use AddWatch if I needed for instance to break if Text
property of the text box is changed to "Hello, World".
In VB.Net I'd like to do the same, but cannot find the way to do it.
AddWatch window doesn't give me the choice to select condition. I can set
condition on BreakPoint in the BreakPoint window only.
So, what do I have to do in order to catch the change of Text property of
the textbox or ActiveRow in Combo and so on?
Thank you
Vlad
- 6
- 7
- 8
- Visual C#.Net >> Javascript firing within a datagridI've got this great wee function which strips out the spaces entered into a
textbox and it does this on the key press off a user. I got this working in a
test application no problem however when I went to intergrate it with my real
application which has the textbox in the footer of a datagrid the javascript
doesn't seem to run. Has anyone any idea why this is not working for me?
Any help would be much appreciated. Thanks
Here is the function and the textbox which I'm using
<script language="javascript" type="text/javascript">
<script language="javascript" type="text/javascript">
function CheckValidAdd(textbox, val)
{
val = val.replace(/[^0-9a-zA-Z]/g, '');
textbox.value = val;
}
</script>
<FooterTemplate>
<asp:TextBox ID="add_NINo" onKeyUp="CheckValidAdd(add_NINo,
add_NINo.value);" Columns="5" Runat="Server" />
</FooterTemplate>
- 9
- Winforms >> Get reference to datagridview column from given coordinates.Does anyone know a method to retrieve a reference to the datagridview
column that contains given client coordinates?
Essentially I am trying to implement drag and drop functionality from a
listbox to a datagridview. In this case I am using an item dragged from
the listbox into the datagridview to rename the datagridview column
where that item is dropped.
I know how to implement the drag and drop functioanlity using events. I
just dont know how to get a reference to the actual column where the
item is dropped. So far I have gotten as far as being able to retrieve
the client coordinates in the datagridview of the actual drop point.
Anyone know how I can use those to get a reference to the column?
Thanks in advance for any help.
- 10
- Dotnet >> ClickOnce: External component has thrown an exceptionHi,
When using clickOnce for a VB.NET 2.0 application it installs fine on every
computer, except one (a new one...). Every is isstalled, Framework, Mdac,
...
The error in the log file is: "External component has thrown an exception"
Does anybody knows what could have caused this problem?
Thansk a lot in advancec
Pieter
The full log file:
PLATFORM VERSION INFO
Windows : 5.1.2600.131072 (Win32NT)
Common Language Runtime : 2.0.50727.42
System.Deployment.dll : 2.0.50727.42 (RTM.050727-4200)
mscorwks.dll : 2.0.50727.42 (RTM.050727-4200)
dfdll.dll : 2.0.50727.42 (RTM.050727-4200)
dfshim.dll : 2.0.50727.42 (RTM.050727-4200)
SOURCES
Deployment url :
file://serverdata/LogicielTrading/Installer/Sogescol.Client.application
IDENTITIES
Deployment Identity : Sogescol.Client.application, Version=0.9.3.5,
Culture=neutral, PublicKeyToken=45ad061d5f374eff, processorArchitecture=msil
APPLICATION SUMMARY
* Installable application.
ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later
in the log.
* Activation of
\\serverdata\LogicielTrading\Installer\Sogescol.Client.application resulted
in exception. Following failure messages were detected:
+ External component has thrown an exception.
COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.
WARNINGS
There were no warnings during this operation.
OPERATION PROGRESS STATUS
* [23/05/2007 13:14:41] : Activation of
\\serverdata\LogicielTrading\Installer\Sogescol.Client.application has
started.
* [23/05/2007 13:14:42] : Processing of deployment manifest has
successfully completed.
ERROR DETAILS
Following errors were detected during this operation.
* [23/05/2007 13:15:59] System.Runtime.InteropServices.SEHException
- External component has thrown an exception.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Internal.Isolation.IStateManager.Scavenge(UInt32
Flags, UInt32& Disposition)
at
System.Deployment.Application.ComponentStore.SubmitStoreTransaction(StoreTransactionContext
storeTxn, SubscriptionState subState)
at
System.Deployment.Application.ComponentStore.SetPendingDeployment(SubscriptionState
subState, DefinitionIdentity deployId, DateTime checkTime)
at
System.Deployment.Application.SubscriptionStore.SetLastCheckTimeToNow(SubscriptionState
subState)
at
System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri
activationUri, Boolean isShortcut)
at
System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object
state)
COMPONENT STORE TRANSACTION DETAILS
* Transaction at [23/05/2007 13:15:59]
+ System.Deployment.Internal.Isolation.StoreOperationSetDeploymentMetadata
- Status: Set
- HRESULT: 0x0
+ System.Deployment.Internal.Isolation.StoreTransactionOperationType (27)
- HRESULT: 0x0
- 11
- Dotnet >> VB.Net and DynamicsHello
Does anybody know if there is a way to dynamically have a dataset linked to a predefined crystal report? The project initially was created to deal with a few static reports but now my client has the need for much more reporting and it would be much easier to do this dynamically, if at all possible
Current situation
User is coming from a form where parameters for a report are specified. These are then passed to the form that will generate the Crystal Report. From this point, a dataset would be created and based on the information, the query that was sent to the database would be displayed in the CrystalReportViewer.
I have yet to figure out a way around this because the crystal report cannot be created without a predefined dataset, and this would seem to suggest that the dataadapter would also have to be predefined. :(
Is there a better way of doing this??
Cheers
Karl
- 12
- ADO >> Subquery Problem in Query BuilderIn Visual Studio 2003 I'm not able to generate a dataset or tablemappings
for an Oracle DataAdapter as long as the SQL in the DataAdapter contains
subqueries (I'm using the Microsoft OLE DB Provider for Oracle and have an
Oracle 8 database). The query works just fine, though, and returns correct
data.
Here's the query ...
SELECT Equipment.*,
(SELECT Equip_IDs.ID_NUMBER
FROM Equip_IDs
WHERE Equip_IDs.ID_TYPE = 'TAG NUMBER' AND Equipment.Equip_ID =
Equip_IDs.Equip_ID) AS TAG
FROM Equipment
Good data is returned both running the query in the Query Builder and by
right-clicking the DataAdapter to "Preview Data."
Nevertheless, when closing the DataAdapter Configuration Wizard I get this
error ...
"There were errors configuring the data adapter."
and when trying to generate a dataset I'm told ...
"Syntax Error: found 'FROM' inside an expression"
Attempting to open the DataAdapter's TableMappings collection, this error
occurs ...
"Unable to retrieve the schema from the database table. Source column
mapping information will not be available. Would you like to continue?"
Anyone recognize what I'm doing wrong here? Appreciate any suggestions.
- 13
- Visual C#.Net >> !!Make $1000 of Money from InternetBring your gang together - do your thing. Start your group.
Are you Interested in Make Billions of Dollars Online.....
Ready to Build Onlie Business Empire.. with out spending Single Cent
To Learn the Art, Just Log onto >> http://puremoneymaking.blogspot.com/
- 14
- Winforms >> MDI OnMouseLeave problemHi,
There seems to be a problem with mouse event handling in controls located on
MDI child forms in .net v1.1. When the control is first made visible it
receives the OnMouse Enter and OnMouseLeave events. If the child form is
then hidden and re-shown only the OnMouseEnter event fires - thereafter
neither event fires, although oddly, OnMouseMove continues to fire.
The code below demonstrates the problem. Form1 is the mdi container and
Form2 is a child form that contains a button control. The main menu item on
Form1 is used to toggle the visibility of Form2. The button is subclassed to
show when the events fire. When form2 is hidden and then re-displayed, the
OnMouseEnter event fires when the button is entered, thereafter neither
event fires until Form2 is re-loaded, but OnMouseMove continues to fire.
If this is a genuine bug, I'd be grateful for any workaround tips.
Thanks
Jon
Imports System.Windows.Forms
Public Class Form1
Inherits Form
Public Sub New()
MyBase.New()
MainMenu1 = New MainMenu
MenuItem1 = New MenuItem
MainMenu1.MenuItems.AddRange(New MenuItem() {Me.MenuItem1})
MenuItem1.Index = 0
MenuItem1.Text = "Toggle"
Me.ClientSize = New System.Drawing.Size(200, 120)
Me.IsMdiContainer = True
Me.Menu = Me.MainMenu1
End Sub
Friend WithEvents MainMenu1 As MainMenu
Friend WithEvents MenuItem1 As MenuItem
Private WithEvents f2 As Form2
Private Sub MenuItem1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MenuItem1.Click
If f2 Is Nothing Then
f2 = New Form2
f2.Location = New Point(10, 10)
Me.AddOwnedForm(f2)
f2.MdiParent = Me
f2.Show()
Else
f2.Visible = Not f2.Visible
End If
End Sub
Private Sub f2_Closed(ByVal sender As Object, ByVal e As System.EventArgs)
Handles f2.Closed
f2.Dispose()
f2 = Nothing
End Sub
End Class
Public Class Form2
Inherits Form
Public Sub New()
MyBase.New()
Dim mb As New myButton
With mb
.Size = New Size(80, 30)
.Text = "winbtn1"
.Location = New Point(10, 10)
End With
Me.ClientSize = New System.Drawing.Size(120, 60)
Me.Controls.Add(mb)
End Sub
End Class
Friend Class myButton
Inherits Button
Protected Overrides Sub OnMouseEnter(ByVal e As System.EventArgs)
MyBase.OnMouseEnter(e)
Console.WriteLine("mybutton mouse enter")
End Sub
Protected Overrides Sub OnMouseLeave(ByVal e As System.EventArgs)
MyBase.OnMouseLeave(e)
Console.WriteLine("mybutton mouse leave")
End Sub
Protected Overrides Sub OnMouseMove(ByVal e As MouseEventArgs)
MyBase.OnMouseMove(e)
Console.WriteLine("mybutton mouse move")
End Sub
End Class
- 15
- ADO >> HERE WE GO AGAIN, Visual Web Developer 2005 Express SCREWS UP YOUR CODE on PURPOSE...STOP TOUCHING MY CODE, MICROSOFT!!!!DEAR MICROSOFT:
STOP TOUCHING MY CODE!!!!!!
Stop ADDING these attributes to my tags
meta:resourcekey="LiteralResource3"
Your Web Developer 2005 express added that crappy and unneeded attribute to
all my tags on my aspx page...you even added that attribute to the @page
directive. The people who actually do work might have to to bounce back to a
better HTML editor and NOT use 2.0 OR I don't even want that attribute in
the first place as I don't place to use .resx files anyway.....
GET IT THROUGH YOUR STUPID HEAD THAT YOU ARE NEVER TO PUT CODE WHEN I DON"T
KNOW ABOUT IT, NOR SHOULD I HAVE TO GO ON A SCAVENGER HUNT TO FIND IT IN THE
SETTINGS JUNGLE.
Who has responsible for doing this on the Microsoft team? ONe of number one
things Microsoft market was trumpeting was that VS.NET 2005 wasn't going to
touch your code...............
DON'T DO THAT!!!
GOT IT!!!!!!
NOW I HAVE TO GO AND REMOVE IT FOR ALL THE TAGS ON MY PAGE IF I WANT TO USE
.NET 1.1
COMPRENDE!!!!!!!
IT'S NO WONDER WHY ASP.NET hasn't been embraced by a significant number of
asp developers, Old ASP developers can get more done using NON-MICROSOFT
TOOLS.....
DROP THE CRAPPY WEB PORT AS WELL..that's stupid, takes up resources and just
make debugging that much more difficult.
LOCALHOST:12345 <-- do we have to do it this way?
Just show them how to set up IIS correctly. PHP, ASP, ColdFusion, Java all
know how to do this manually, Why does microsoft have to screws things up
again..
|
|
|