Auto mail from SQL
Hi
can any one tell me that how i can send email to my registered clients
from sql store procedure if they meet some specific critaria. and this
store procedure will automaticelly execuate after every 10 minutes and
check the database. if any client meet the critari specified a mail
will be send to that client.
thanx Tag: Datagrid Update Tag: 120825
How to improve performance of Queue accessing between 2 threads?
Dear Guys,
I write program that sharing Queue between 2 threads which 1 thread add data
to Queue. And another thread get data from Queue to process. My situation
is if there are alot of data to add (like loop to add). The 2nd thread which
try to get data from Queue cannot access or rarely to access that Queue which
make the program has low performance.
How can I do to improve this situation? I want 2nd thread can access as
fast as possible once Queue is not empty.
Here is some snippet code:-
Thread#1
For i as Integer = 1 To 1000
SyncLock _queue.SyncRoot
_queue.Enqueue(i)
_newItemEvent.Set()
End SyncRoot
Next
Thread#2
Dim item As Integer
While _queue.Count <= 0
Thread.SpinWait(0)
End While
While _queue.Count > 0
SyncLock _queue.SyncRoot
item = DirectCast(_queue.Dequeue(), Integer)
....
End SyncLock
End While
Thanks,
Thana N. Tag: Datagrid Update Tag: 120824
.NET Snippets
Hello,
I would like to show you my new web page. On this site you can publish
and download .NET code - snippets for free.
Please tell me your opinion, and have much fun to publish new snippets.
This is the Link: http://www.dotnet-snippets.de/dns_en/Default.aspx
Jan Tag: Datagrid Update Tag: 120822
.NET Codesnippets
Hello,
I would like to present my new web page to you. On this site you can
publish and download .NET code - snippets.
Please tell me your opinion, and have fun to publish new snippets.
This is the Link.
Jan Tag: Datagrid Update Tag: 120821
Dirty property value persist problem in asp.net custom control
Hi,
I created a custom control, and encountered a dirty property value
persistence problem.
I created a property with a custom class type, call SQLSettings which
holds the SQL connection parameters, the class as follows:
public sealed class SQLSettings
{
private string serverName;
.......
public SQLSettings()
{
this.serverName = string.Empty;
......
}
[NotifyParentProperty(true)]
public string ServerName
{
get
{
return this.serverName;
}
set
{
this.serverName = value;
}
}
..................
And, I also created an mapping TypeConverter and UITypeEditor classes
to handle the design-time founctinality. The property I created in my
conbtrol as follows:
[BrowsableAttribute(true)]
[CategoryAttribute("Behavior")]
[BindableAttribute(true)]
[NotifyParentProperty(true)]
[EditorAttribute(typeof(SQLSettingsUITypeEditor),
typeof(UITypeEditor))]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
[TypeConverter((Type)typeof(SQLSettingsTypeConverter))]
[PersistenceModeAttribute(PersistenceMode.InnerProperty)]
public SQLSettings SQLSettingsData
{
get
{
return this._sqlSettings;
}
set
{
this._sqlSettings = value;
}
}
They all works fine when first set value to this property, I can see
the persisted data showed in .aspx file. When I go back to design view
and update the property value via my UITypeEditor, I can see the value
already updated in VS.NET properties browser. But when I turn to see
.aspx file in code view, I didn't see the dirty property value updated
in .aspx file. When I turn to design view, the updated property value
is lost, it remain keep the first persisted value.
How about to solve this problem? Any idea?
Thank you for your kindly help. Tag: Datagrid Update Tag: 120820
WebRequest Exception: "The attempted operation is not supported for the type of object referenced"
We have written an asynchronous download class that uses the WebRequest
to perform downloads. Things are working fine in-house, and it's fine
for the vast majority of our users, but there is an increasingly large
of people who are getting the following exception:
Exception Type: System.Net.Sockets.SocketException
ErrorCode: 10045
SocketErrorCode: OperationNotSupported
NativeErrorCode: 10045
Message: The attempted operation is not supported for the type of
object referenced
Doing a search on that phrase ("The attempted operation is not
supported for the type of object referenced") almost immediately led me
to this page: "How to determine and recover from Winsock2 corruption"
http://support.microsoft.com/kb/811259
Using the instructions on that page has worked for 100% of the users
with the problem! At first I though, "Great!" But now we're seeing a
lot of these, and I'm starting to think that since it's not that
isolated, it might not really be a true "problem" on their machines.
It might be a firewall program or some other incomptaibility. Have
other people seen this before? Do you know of something "innocuous"
that could be causing the SocketException?
Any hints, guesses, or shots in the dark would be greatly appreciated.
Many thanks,
Taylor Tag: Datagrid Update Tag: 120817
'System.InvalidOperationException'
An unhandled exception of type 'System.InvalidOperationException' occurred
I am getting this error when running the built executable directly from the
bin folder -- however, it doesn't give me the error when I run from within
the IDE
(DEBUG or RELEASE).
It does seem to run fine on another computer.
System.InvalidOperationException was unhandled Message="An error occurred
creating the form. See Exception.InnerException for details. The error is:
The type initializer for 'Falcon.PrintConsole.modGlobal' threw an
exception."
Source="Falcon.PrintConsole"
StackTrace:
at Falcon.PrintConsole.My.MyProject.MyForms.Create__Instance__[T](T
Instance)
at Falcon.PrintConsole.frmMain.Main()
Help? Tag: Datagrid Update Tag: 120816
Cannot create ActiveX object (on Windows 2000)
I have made a small interop function that uses Acrobat Distiller.
It works smothly on all the XP machines, but when I try to run it on a
Windows 2000,I get this error:
System.Exception: Cannot create ActiveX component.
at Microsoft.VisualBasic.Interaction.CreateObject(String ProgId, String
ServerName)
at MediaBuilder.Utils.PDFCreator.PDFCreator.Main(String[] args) in C:
\Visual Studio Projects\Utilities\PDFCreator\Main.cs:line 31
And line 31 looks like this:
objDist = (ACRODISTXLib.PdfDistiller)
Microsoft.VisualBasic.Interaction.CreateObject
("PdfDistiller.PdfDistiller","");
What is the difference between running this under XP and 2000?
The odd thing is, that I can compile it with out errors on the 2000, it is
just when I run it, I get this error.
Could it be because of the call/use of
Microsoft.VisualBasic.Interaction.CreateObject, that should work W2KSP4.
I have also tried DCOM configuration
(http://support.microsoft.com/kb/q183607), but even with even with this, I
still get the error. Tag: Datagrid Update Tag: 120814
Problem with ColorDialog and MenuStrip
Hi,
problem #1 : I have a MenuStrip on my Windows form and it doesn't get
painted (is transparent) unless I move the form... Anyone ever encountered
this? Anyone knows what could cause it?
problem #2 : I want to make a ColorDialog appear, but everytime I want to
show it, it appears behind my form so I have to go to another application
and go back to my application to see it. Is it a bug? Here's the code
(can't be simpler)
ColorDialog cd = new ColorDialog();
cd.ShowDialog();
Can anyone help please?!? These are the last two known bugs in my
application.
Thanks
ThunderMusic Tag: Datagrid Update Tag: 120813
MSIL Inquiry involving boxing
Hi,
I'm following a tutorial and they translate this C#:
object[] a = {1, "Hello", 123};
to this IL:
.entrypoint
.locals (class System.Object[] V_0,class System.Object V_1,class
System.Object[] V_2,int32 V_3)
ldc.i4.3
newarr [mscorlib]System.Object
stloc.2
ldloc.2
ldc.i4.0
ldc.i4.1
stloc.3
ldloca.s V_3
box [mscorlib]System.Int32
stelem.ref
ldloc.2
ldc.i4.1
ldstr "Hello"
stelem.ref
ldloc.2
ldc.i4.2
ldc.i4.s 123
stloc.3
ldloca.s V_3
box [mscorlib]System.Int32
stelem.ref
But when I compile similar code, I get a big difference. Instead of putting
the integers in a local variable, they are stored directly and boxed via:
IL_0006: stloc.2
IL_0007: ldloc.2
IL_0008: ldc.i4.0
IL_0009: ldc.i4.1
IL_000a: box [mscorlib]System.Int32
IL_000f: stelem.ref
IL_0010: ldloc.2
IL_0011: ldc.i4.1
IL_0012: ldstr "Hello"
IL_0017: stelem.ref
IL_0018: ldloc.2
IL_0019: ldc.i4.2
IL_001a: ldc.i4.s 123
IL_001c: box [mscorlib]System.Int32
IL_0021: stelem.ref
The big difference is that the number is pushed directly on the stack and
boxed, rather than the number going into a local variable and the address
being pushed and then boxed.
So 2 questions:
1) Why would there be a difference? I tried both 1.1 and 2.0 compilers, but
can't seem to get the ldloca.s version?
2) The more interesting question is how does the box instruction work on a
"transient pointer?" Here's the interesting segment:
ldloc.2 <- push address of array
ldc.i4.0 <- push index 0
ldc.i4.1
stloc.3 <- store number one in local integer variable V_3
ldloca.s V_3 <- Put address of local variable on stack
box [mscorlib]System.Int32 <- I guess Box will be able to work with
the address??? and make a box based on the dereferenced address?
stelem.ref
For those curious, the tutorial I'm following is:
http://www.vijaymukhi.com/documents/books/ilbook/chap12.htm
And do a search for the text "It is in stelem.ref and we are not privy to
this code". (It's the following example, after this text)
Thanks all...
-Ben Tag: Datagrid Update Tag: 120812
HttpModule not working with GAC
Hi All,
I am facing this strange problem here.
I have created a custom HttpModule to filter the response. It worked
fine when i tested it as a part of my existing project. But when I
created a new project and got a dll after strong naming it and putting
into GAC, it wouldn't work any more. I have added a new entry in
machine.config under <httpModules> tag to make it filter each asp.net
response.
But I have no clue why its not workig now.
Any help would be highly appreciated.
Thanks.
VD Tag: Datagrid Update Tag: 120810
Framework Install Error
Hi Folks,
I've hit the dreaded Error 25015 installing Framework 2.0 on WinXP :
---------------------------
Microsoft .NET Framework 2.0 Setup
---------------------------
Error 25015.Failed to install assembly
'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.VisualBasic.Vsa.dll'
because of system error: The process cannot access the file because it
is being used by another process.
I've tried the tips online - virus checker, permissions, cleanup tool
etc. No luck. Only process accessing the file is the installer itself.
Any suggestions?
Thanks,
Davy Mitchell Tag: Datagrid Update Tag: 120805
'System.InvalidOperationException'
An unhandled exception of type 'System.InvalidOperationException' occurred
I am getting this error when running the built executable directly from the
bin folder -- however, it doesn't show when I run from within the IDE
(Debug).
I've not tried it using Release - as I'm not wanting to "fix" the problem
inadvertantly simply by switching modes (if that makes sense).
I'm seeing lots of posts regarding this, but all seem general - and none of
them, that I found, relate to running under the IDE vs the EXE.
I sent the EXE to a collegue who seems to be able to run it just fine. I'd
like to find out what it will take to get it working on my dev box, as I'm
sure the first customer we install this on will have the same problem (don't
ask me how I know, I just do -grin )
Help? Tag: Datagrid Update Tag: 120803
unrecognized attribute xmlns
I get this error accessing a 2.0 site on a web server previously running .net
v1.1.
I've installed v2.0. I've run aspnet_regiis -i. I've changed the ASP.NET
version on the ASP.NET tab in IIS. But it still uses the v1.1 framework.
Any suggestions? Tag: Datagrid Update Tag: 120793
Diagnosing System.IO.IOException
I have an application that generates and moves 1000s of small text files.
Every so often for some unknow reason I start to get the following 2
exceptions:
System.IO.IOException: Not enough quota is available to process this
command. at System.IO.Directory.GetFiles(String path, String searchPattern)
and (if the first exception does not happen we get a bit further and try to
move the files we found)
System.IO.IOException: Insufficient system resources exist to complete the
requested service. at System.IO.File.Move(String sourceFileName, String
destFileName)
I can see no problems with available memory, the app does not use huge
chunks of resources as far as I can tell from taskman and process explorer,
restarting the application clears the problem. Load on the app does not seem
to cause it as I can hit it VERY hard and it does not fail.. this leads me to
think it is down to another application or the OS.
Has anyone else seen this or got any good ideas on how to track the cause? Tag: Datagrid Update Tag: 120789
DataTable.Select Aggreate function
Hi Newsgroup
I've the following problem:
i have a statement on a DataTable thats looks like:
BKD.Select(string.Format("{0} = MIN({0}) AND {1} = {2} AND {3} = {4}",
BKD.PeriodeVon.ColumnName,
BKD.HerkunftsRefNr.ColumnName, rowBKD.HerkunftsRefNr,
tmBKD.BKD.StatusCd.ColumnName, BKDStatusCd.Differenziert)
I always get an Array back with length zero but the Data i'm looking for are
in the DataSet.
Is it not possible to do an aggregate function and other filtering in the
same statement?
Thanks in advance
Stefan Tag: Datagrid Update Tag: 120782
Not able to run Quick start application in Enterprise library 2.0
Hi,
I just read the article about Enterprise Library 2.0 , well its
intresting and am new to it ... and happen to see the examples that was
given in quick startapplicaion about
Caching Application Block.
Cryptography Application Block.
Data Access Application Block.
and others too..
but when i run the application like (Open-> website->CS (caching
program) , and i re-built it
and when i run it the page displays:
[CODE]
Directory Listing -- /CS/
--------------------------------------------------------------------------------
Monday, August 14, 2006 02:37 PM <dir> CryptographyQuickStart
Thursday, January 05, 2006 09:58 AM 3,600
CryptographyQuickStart.sln
Tuesday, August 22, 2006 07:24 PM 1,585 Web.Config
--------------------------------------------------------------------------------
Version Information: ASP.NET Development Server 8.0.0.0
[/CODE]
why is that ..? this happens for all the quick start samples...
waiting for ur reply ... Tag: Datagrid Update Tag: 120780
system.badimageformatexception returned from custom installer
I have a web project that I have converted from VS 2003 to VS 2005. The
installer is configured to use detect a newer version and if found to
uninstall the old version before installing the new version.
The installer in the new version VS 2005 contains custom actions that are
compiled with VS 2005. For launch conditions, I have configured the .NET
Framework to be at 2.0.50727 and Allow Later Version si set to True.
When I run the installer I receive the system.badimageformatexception which
references the dll that contains the custom installer code.
If I uninstall the 2003 version of the software and then do an install of
the 2005 version everything works fine. But if I have the 2003 version
installed and then run the installer for the 2005 version I receive the error
about the bad image.
Is this a bug? Am I doing something wrong? Are there workarounds? Will my
customers have to uninstall the old version manually before installing the
new version?
Thanks,
Leslie Tag: Datagrid Update Tag: 120777
Credientials to an HTTP POST request.
I am trying to post an HTTP request to a site that requires a user name and
password. I am trying the following:
objRequest =
DirectCast(System.Net.HttpWebRequest.Create(urlString),
System.Net.HttpWebRequest)
Dim credentials As New CredentialCache()
credentials.Add(New Uri(urlString), "Basic", New
NetworkCredential("user", "password"))
'Dim credentials As NetworkCredential = New NetworkCredential()
objRequest.Credentials = credentials
But using Fiddler I don't see any of the security authorization header
information so I am wondering if the user name and password is getting
passed. First does the above look correct?
Thank you.
Kevin Tag: Datagrid Update Tag: 120776
Problem with simple calculation
I am currently using the following
Studio 2005: 8.0.50727.42 (RTM.050727-4200)
.NET Framework: Version 2.0.50727
When doing the following in C#
double a = 11.08;
double b = 11.04;
double c = a - b;
I get 0.0400000000000009 instead of 0.04. Why is this?
Am i missing something?
Thanks Tag: Datagrid Update Tag: 120771
System.Net.Mail.SmtpClient
I am using SmtpClient.Send method to send emails from a windows service
running under LoacalSystem credential. This program does not receive an
exception when the Send method is called for a bogus email address. I am
using my email address as FromAddress. The Host property is referencing a
SMTP server on the network. I receive a delivery failure email in my Inbox.
How can make it work so that I receive a SmtpFailedRecipientsException when
the target email address is invalid?
Thanks. Tag: Datagrid Update Tag: 120768
saving common settings/data without administrative privileges
I am trying to find a way to save common data in my program that will not
change from different users. I tried both HKEY_LOCAL_MACHINE and writting to
an ini file and storing it in my Program directory. However, in order for
this to work, all the users need administrative privileges.
Is there a proper way to store common data that I am not aware of?
For example, I have a test number that I need to increment. And this test
number must not change when the user changes. Tag: Datagrid Update Tag: 120760
Windows Service project and how to debug
Hi,
I created a Windows Service project, the installers and the setup project
for the service. Now I have the service installed but once I start it up,
it's taking 100% CPU and not doing anything. I tried attaching the visual
studio debugger to the win service process but it's not stopping at any
breakpoints.
Does anyone have any idea about why it's taking the 100% CPU.
And how can I debug and see what's going on?
Thanks very much in advance!!
Agnes Tag: Datagrid Update Tag: 120759
saving common settings without non-administrative privileges
I am trying to find a way to save common data in my program that will not
change from different users. I tried both HKEY_LOCAL_MACHINE and writting to
an ini file and storing it in my Program directory. However, in order for
this to work, all the users need administrative privileges.
Is there a proper way to store common data that I am not aware of?
For example, I have a test number that I need to increment. And this test
number must not change when the user changes.
Thanks Tag: Datagrid Update Tag: 120755
CrystalReportViewer - Missing Group Headers in Preview
I have a VS2005 C# windows application that uses the CrytalReportViewer
(Crystal Reports XI Release 2 w/SP1) to view a report. I have two development
systems;
System1: Windows XP Pro x64 (desktop)
System2: Windows XP Pro (laptop)
When I run the app on System 1, the group headers and any lines are not
visible when previewd on the screen. When exported to pdf or printed, all
headers and lines are printed as expected.
When I run the app on System 2, the preview is shown as expected.
Any one run into this issue, and even better, have an idea of how to resolve
it?
thanks
--
dchman Tag: Datagrid Update Tag: 120754
HttpCFG DS Mapping not working
I'm trying to configure DS Mapping with httpcfg. I have a test application
using HttpListener which is listening on port 8001 ssl.
To configure the ssl certificates I used httpcfg. This is my command:
httpcfg set ssl -i 0.0.0.0:8001 -f 3 -c "MY" -h <Certificatehash>
-f 3 : Should take care of mutual authentication and with DS Mapping. But
it is not working.
I know for sure the certificates are fine, and my AD mapping is ok, because
if I test with IIS, it works perfect, and authenticates the client with the
Windows user. But as soon as I move to my application and httpcfg, it
validates the certificates, but it does not authenticate the client with a
windows user. I'm using Thread.CurrentPrincipal.Identity.IsAuthenticated
to see if it is working.
http query ssl shows this:
------------------------------------------------------------------------
IP : 0.0.0.0:8001
Hash : 669b8ab4172fd790d8d5c9aca643f8fbd7 332b1
Guid : {00000000-0000-0000-0000-000000000000}
CertStoreName : MY
CertCheckMode : 0
RevocationFreshnessTime : 0
UrlRetrievalTimeout : 0
SslCtlIdentifier : (null)
SslCtlStoreName : (null)
Flags : 3
Can anyone help me??
Tks
--
Oliver Quixchan
Developer Tag: Datagrid Update Tag: 120745
XmlSerializer usage
1) I have an XSD that defines a document structure
2) I have a business object whose internal state can be represented by an
XML document that is conformant to the XSD specification
Many times, the first thought a lot of folks have is, "Silly, just run your
XSD through xsd.exe and you can get a dataset or a class model!" That's not
going to work for me, though. My business object contains a good bit of
logic and the lightweight zero-method classes that are generated by xsd.exe
are not appropriate for what I'm doing.
So, I decided to take the approach of implementing the IXmlSerializable
interface instead. Life is good. I'm curious, though, how folks insulate
their business object from changes in the schema? This object's state is
being persisted as an XML string. There will come a time when I have to
change the XSD to encance the feature set. So, my class will have to be able
to Deserialize its state from either of 2 (or more) different XSD Schemas
because there may be older persisted versions (and yes, I want to validate
the XML).
How do people generally handle this scenario? (no...just not validating the
XML is not an option)
Here's my approach:
If the Class is called Person, then
The Class Person Implements the IXmlSerializable interface
The Person class has a number of private nested classes (so they have access
to the Person class's state fields). These are called
DeSerializationFactory
Version1Deserializer
Version2Deserializer
Version3Deserializer
...
VersionNDeserializer
Serializer
When ReadXml is called on the Person Class, the NamespaceURI property is
checked. Based on the value of that property a Version[1 2 or 3]Deserializer
is created via the DeSerializationFactory. The resultant serializer
deserializes the state and then life is good.
When WriteXml is called, the default Serializer instance is created and the
state is written as XML (always the latest version).
This seems to be working for me, but I was curious how other folks mitigate
this. Tag: Datagrid Update Tag: 120742
javascript to datagrid itemtemplate textbox
hi,
How do i pass a javascript value to datagrid itemtemplate textbox using
javascript. Kalaivanan Tag: Datagrid Update Tag: 120738
Command Line Compailation
Hi,
My Vb.net solution file contain 3 projects. There are Client ,Business
Logic, Data Access.
I want to compail my total solution from command line.
Can any one help me for this.
--
Regards,
R.Sathiamoorthy Tag: Datagrid Update Tag: 120735
Component One TrueDB Fetch row style
I knew how to do it in VB6 but I can't figure it out in VB.NET
In vb6 I did this
Private sub TGDB_FetchRowStyle(...)
dim RStemp as recordset
RStemp = RSMaster.clone
RStemp.bookmark = RSmaster.bookmark
if rstemp!somefiled = "something" then TGDB.rowstyle=something
SET RStemp=nothing
End Sub
And i don't know what to do in VN.NET
I use DataTable to fill the grid TGDB.SetDataBinding (DataTableName,
Nothing, True)
I can't find a example...
Thanks
--
You're not paid to think. A mindless worker is a happy worker. Shut up
and do your job!
- Tata Feudalac!
--------------------------------------------------------
http://www.fotozine.org/index.php?stranica=clan&uid=1352
http://www.thinkgeek.com/brain/gimme.cgi?wid=81d35dc8f
http://groups.google.com/group/fejkneraddangub
-------------------------------------------------------- Tag: Datagrid Update Tag: 120723
How To: Setup project Custom dialog boxes
Hi
In my setup project I need a custom dialog box containing a drop down
list box. Since this is not avaialble from standard user interface
dialog boxes that visual studio supplies, I am using Installer class.
This installer class inturn displays the custom dialog box i need. but
the problem is this custom dialog box is displayed as a popup window
during installation. But I want this custom dialog box to be shown as
one of the wizard pages during installation.
Has any one done this before? I know some few setup programs that do
this. However I am not sure that they used visual studio setup and
deployment project to create their setup programs.
Thanks
Gancy Tag: Datagrid Update Tag: 120721
Drawstring inserts spurious linebreak after character #132
I am using DotNet v1.1.4322.
This issue can be replicated with various text fonts - but is easiest to see
using WingDings.
1) Create a string which includes character #132
2) Draw it to a Graphics object with DrawString
S := #130+#131+#132+#133+#134+#135+#136+#137+#138+#139;
F := System.Drawing.Font.Create('WingDings', 16);
G.DrawString(S, F, Brushes.Black, 0, 0);
The output always wraps immediately after character #132, regardless of font
size, StringFormat settings, etc.
Is this a bug in DrawString, or is it due to some other setting of which I
am not aware?
Does it happen in DotNet v2? Tag: Datagrid Update Tag: 120720
ControlToValidate = Page?
Is there a way to make a custom validator that will act as a client
side (run time) validator for the entire page (.aspx)? I would like to
show a short validation message without having to postback to check if
the page.Isvalid = true. Tag: Datagrid Update Tag: 120712
.Net x64 / x32 incompatibility "is ambiguous in the namespace"
I ma trying to compile my XP x32 build after reboot into XPx64 as native x64
application. In VS2005 I changed my VB.net configuration to x64 and changed
the reference path to point to c:\windows\microsoft.net\framework64 (before
it was without the 64). Most things fell into place after these changes, but
several classes are no longer available in the interllisense completion list
and they are listed as errors as well. Even simple things such as
Debug.Assert() are no longer available. Sample error: 'Debug' is ambiguous in
the namespace 'System.Dosagnostics'.
Do those classses really not exist as 64 bit version?
What is the best way to resolve this?
Thanks, Ingmar Tag: Datagrid Update Tag: 120710
Seemingly simple regex question
I'm using the following regex expression where "searchword" is a string:
string regrexstr = @"( |^)\b" + searchword + @"+( |\b)"
My goal is to use this string to ultimately replace all occurances of
searchword as long as:
a) it has a preceeding space or it's the beginning of a line AND
b) it is suffixed with a space or a newline character
The problem right now is that using the above string and calling
Regex.Replace also replaces the leading/trailing spaces. I want the spaces
to count during the match, but be ignored during the replace. Is that
easily do-able?
I'm probably going about this the wrong way. In short, I want to do a word
replacement throughout a large file.
TIA!
-sb Tag: Datagrid Update Tag: 120706
Wanted: .NET Infrastructure book
Hi folks,
I work in IT, but on the infrastructure/engineering side. At work I'm now
being asked to design infrastructure solutions to support new .NET
applications. Typically, this infrastructure must be highly available and
support things like load balancing etc.... the only problem is I don't have
a thorough understanding of how to accomplish this. Is the infrastructure
tiered? How does the presentation layer talk to the middleware? These are
the types of questions I have.
I want to get a grounding how infrastructure wraps around the .NET framework
and how enterprise solutions are designed. Can anyone point me in the right
direction? eg... a good book or the like.
cheers, froowstie Tag: Datagrid Update Tag: 120705
Error with SqlSmlCommand
I am attempting to read XML data directly from a table in SQL Server
2000 using VB.Net 2003. When I run the code shown below, I get the
following error:
"SQLXML: invalid direct object (dbobject) query -><-"
I applied SqlXml 3.0 Service Pack 3 to both client and server. My
project references Microsoft.Data.SqlXml. Client is Windows XP Pro,
Server is Windows Server 2003 with SQL Server 2000. All service packs
and patches are current.
'----------------------------------------------------------------------------
Imports Microsoft.Data.SqlXml
Private Sub ReadXML()
Dim CS As String = "Provider=SQLOLEDB; Data Source=MyServer;
Initial Catalog=MyDB; User Id=MyUser; Password=MyPassword"
Try
Dim cmd As New SqlXmlCommand(CS)
cmd.CommandType = CommandType.Text
cmd.CommandText = "Select parent_ID from tblData _
FOR XML AUTO, ELEMENTS"
Dim xr As XmlReader
xr = cmd.ExecuteXmlReader '<------Error happens here
xr.Close()
Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
End Try
End Sub
Can anyone figure out what I'm missing? Specifying column names in the
SQL also has no effect. I tried adding a root tag to the command using
the code below before executing the reader but it had no effect.
cmd.RootTag = "xmlns:sql=""urn:schemas-microsoft-com:xml-sql"""
Thanks,
John Tag: Datagrid Update Tag: 120701
PublicKey of System.Xml assembly
I need to make some classes in my assembly internal. I am using XMLSerializer
to serialize the objects of my classes. XMLSerializer cannot access my
internal classes. So I am thinking that adding System.Xml as a friend would
make my internal classes visible to XMLSerializer.
Adding System.Xml as a friend requires public key of the System.Xml assembly
specified. I can get the PublicKeyToken, but not the public key. I tried
following code also but no luck, it just returns 16 bytes (0000000040000000).
Assembly assembly = Assembly.GetAssembly(
typeof(System.Xml.Serialization.XmlSerializer));
byte[] pubkey = assembly.GetName().GetPublicKey();
Any ideas to get the public key of System.Xml assembly, it doesn't have to
be programatically.
Thanks! Tag: Datagrid Update Tag: 120700
WSS document event handler that will use System.web.mail sendmail
I am not using vs studio 2.0 I have 1.1
I have a WSS document event handler that works on a document insert, I want
to use system.web.mail to get to sendmail and put out an email. Document
event handlers are written with C# class library which does not allow me to
reference system.web.mail. I use use the interface with a web control and
reference the web control from within the document event class but when I
compile I get
c:\Documents and Settings\cmello\My Documents\Visual Studio
Projects\SISWorkflow\bin\Debug\SendMailCtrl.dll Referenced class
'SendMailCtrl.DocLibSendMail' has base class or interface
'System.Web.UI.WebControls.WebControl' defined in an assembly that is not
referenced. You must add a reference to assembly 'System.Web'.
I am thinking that is because in the SendMailCtrl dll there is a method that
uses SendMail and the reference to System.web.mail inside the web control
project is the reason that I cannot create a new instance of the web control
object in my C# document event library and call the method to send mail.
Help!! please I need to have a document library insert event send my custom
email to users who have alerts set without having to go into CAML and rewrite
the alert notification AARGH
--
cindy Tag: Datagrid Update Tag: 120695
StatusStrip layout
Greetings,
We are using StatusStrip to present various status messages, progress
bars, and so forth, throughout the user experience. We are finding,
however, that the layout leaves something to be desired, or we do not
have a good understanding of how layout is managed.
In particular, how does one designate specified regions for one text or
another or a progress bar? For example, without things hiding and
moving around? Is there a way to do this, something like what taskbar
does for us, or what one might find in Microsoft Word or Excel?
Thanks in advance.
Best regards,
Michael Tag: Datagrid Update Tag: 120691
Setting StringBuilder.Length not behaving per documentation
Perhaps this has been discussed elsewhere - if so, I couldn't find it.
The StringBuilder.Length property is explicitly documented as padding the
length with spaces if .Length is set to a value greater than the current
length. I'm hoping to get this behavior. However, when I set .Length to
something greater than the current length, the padding is done with null
characters ('\0'), not spaces. Is this the actual intended behavior (and the
docs are wrong) or a bug (and the docs are right)?
Any help in this would be appreciated. Thanks,
Donnie Tag: Datagrid Update Tag: 120686
Serialization Files Compatibility
I pciked up a project and am encountering several deficiencies on the
architecture.
My current concerns are the persisted data files that are written and read
through dynamic reflection and Serialization/De-Serialization. The
application has been going on for a while and is using .Net Framework 1.1.
They intend to switch to .Net Framework 2.0. If data files are saved through
an application saved on .Net 1.1 and later attempted to read through an
application running on the .Net 2.0 Framework, will it work? Also, this is
a number crunching application. There will be versions running on 32-bit
machines and 64-bit machines. Can Serialized data files be shared between
versions of the application running on the 2 platforms?
--
Ed Reyes Tag: Datagrid Update Tag: 120685
ClickOnce - Setting up a staging and production versions
I want to be able to install a staging version and production version on my
desktop of a ClickOnce application. I have created two separate virtual
directories on a web server. I changed the product name in the Publish -
Options dialog. When I install from the staging location, it overwrites my
production version that was installed from the production virtual directory.
Is there a product guid that is maintained?
Any way to accomplish this? Tag: Datagrid Update Tag: 120680
modify the keyboard queue
Hi
I need to be able to modify the keyboard queue and I have no idea how to do
it. I have a windows app (C#) that should login to another application when
pressing a login button. I have no access to the other application so I would
like to add the username and password to the keyboard queu and login to the
third part application that way.
Is this possible to do? Does anyone knows where to find some information
about this area?
Thanks a lot
Julia Tag: Datagrid Update Tag: 120679
creating a compile time error... is it possible?
Hi,
I'd like to create a compile time error in my class... maybe there's a way
already built in in the framework so I can achieve what I want... I have 2
constructors in my class. One of them has mandatory parameters, I mean, they
should not be null nor empty (for strings). So I'd make the validation in
the constructor and generate a compile-time error if the validation does not
match...
Is there a way to achieve this or to specify mandatory parameters? (I'm
using C#)
thanks
ThunderMusic Tag: Datagrid Update Tag: 120677