UI.WebControls TreeView
Hello.
I have trouble with the microsoft treeview. When I run my project local
everything seem to work. When I upload the project to the server I do the
following.
- Release project
- Copy Project. (Only files needed to run this application
- Upload the project to the server.
When I open the webpage with my project och open the page with the treeview
I only see text. Like this
Publika bilder Flags 121.gif 134.gif canada.gif china.gif flag.gif
flags_1142.gif flags_1143.gif flags_1144.gif flags_1145.gif france.gif
isril.gif mexico.gif
No nodes......
Regards... Tag: How can i generate sample xml file with data from xsd schema? Tag: 102377
Sending email with attached files via WebDAV for Exchange
Hi all,
Anybody know how to send email message with attached files via WebDAV for
Exchange (MS Exchange 2003 Server).
Please, please, please! Need help! ASAP!!!!
Tnx,
Lev Tag: How can i generate sample xml file with data from xsd schema? Tag: 102376
Security Appl. Block using AzMan
Hello All,
I have assigned a task to create a security application block using
Authorization Manager/ADAM. In abstract all roles and operation would
be saved in Authorization Manager (AzMan) and Main page would be shown
based on roles and operations user is assigned to using security
application block.
In this regard, if any one has any article/step-by-step guide or any
informative document, please share with me.
cheers!
iusfani Tag: How can i generate sample xml file with data from xsd schema? Tag: 102373
Difference in XML serialization between Win 2000 and Win XP ?
Hi, I'm getting some very odd (to me atleast) results when writing a
serialized object to disk as an xml file.
It works correctly in WinXP but not in Win 2000.
This is the code:
XmlSerializer x = new XmlSerializer( typeof(OptionsHolder) );
TextWriter writer = new StreamWriter( "serversettings.xml" );
x.Serialize( writer, opt );
writer.Close();
and the object has the following class:
public class OptionsHolder
{
public int timeout;
public string lastrapportdate = "";
public string lastprintdate = "";
public bool deleteNonConfirmed = true;
public string defaultProject = "obevakad";
public string [] watchprinters; // = new string[256]; // Max 256 skrivare på
en server
public string [] dontwatchprinters; // = new string[256]; // Max 256 skrivare
på en server
public string [] ignoreips; // = new string[256]; // Max 256 klienter kan
ignoreras
public OptionsHolder()
{
}
}
On Win 2000 it just refuses to write whatever string is currently present in
lastrapportdate.
I have verified that there is content in the variable before serializing.
All other items get dumped to disk.
Result after serializing in WinXP Proffesional
<?xml version="1.0" encoding="utf-8" ?>
- <OptionsHolder xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<timeout>5</timeout>
<lastrapportdate>2005-09-04:21:23</lastrapportdate>
<lastprintdate />
<deleteNonConfirmed>true</deleteNonConfirmed>
<defaultProject>Obevakad</defaultProject>
<watchprinters />
- <dontwatchprinters>
<string>Microsoft Office Document Image Writer</string>
<string>Apple LaserWriter 12/640 PS</string>
</dontwatchprinters>
<ignoreips />
</OptionsHolder>
Result after serializing in Windows 2000 Pro
<?xml version="1.0" encoding="utf-8" ?>
- <OptionsHolder xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<timeout>5</timeout>
<lastrapportdate />
<temp />
<lastprintdate />
<deleteNonConfirmed>true</deleteNonConfirmed>
<defaultProject>Obevakad</defaultProject>
<watchprinters />
- <dontwatchprinters>
<string>Microsoft Office Document Image Writer</string>
<string>Apple LaserWriter 12/640 PS</string>
</dontwatchprinters>
<ignoreips />
</OptionsHolder>
Any ideas?
///. Tom Hellstrom
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =---- Tag: How can i generate sample xml file with data from xsd schema? Tag: 102368
Thread.Start()
In the following example, could HasStarted() ever return false (meaning
that ThreadJob() would get called *after* Foo() returns)?
Basically I don't ever want Foo() to return until after the thread has
executed.
------
void Foo() {
Thread thread = new Thread(ThreadJob);
thread.Start();
if (HasStarted(thread)) {
thread.Join();
}
}
void HasStarted(Thread t) {
return
t.ThreadState & (ThreadState.Stopped | ThreadState.Unstarted)) == 0;
}
------
I ask because I don't know for sure what exactly happens when
Thread.Start() is called. Tag: How can i generate sample xml file with data from xsd schema? Tag: 102363
problem with VB code on some machines (.net bug may be)
I have made my first visual basic .net 2003 application and I get the
following message on 1 of my computers (it works on 3 others).
Mailer4u.exe - Common Language Runtime Debuggin Session
Application has generated an exception that could not be handled.
Process id=0x6b4 (1716), Thread id=0xc70 (3184).
Click OK to terminate the application
Click CANCEL to debug the application
I searched on google and found 1000's of people with the same problem for a
range of applications. Every one had different reasons and not one had a
working solution / fix. If any body has an idea can you let me know. If you
could also email me at d a v i d @ j e m d a m . c o m that would also help
(remove all the spaces from the email address first).
If someone would like to try my code on their computer and see if they can
repeat the problem you can download it here:
http://www.mailer4u.com
Thanks in advance for any one who can figure it out.
David Tag: How can i generate sample xml file with data from xsd schema? Tag: 102358
System.Net.HttpWebRequest - help
Thanks folks!
I'm new to this.
I'm trying to send a username , password to a website from my vb program
using httpWebRequest
I know how to set up the request and how to send a string via GetRequestStream
also how to to get the response.
Totally lost on how to send the username, password to the webpage for login.
Presently my request returns the html text for the login page.
Any help would be welcomed
--
Roger
--
Roger Tag: How can i generate sample xml file with data from xsd schema? Tag: 102350
Hashtable thread safety?
It doesn't seem completely clear to me which operations I can perform while
continuing to be thread-safe on a Hashtable. Consider this scenario:
Hashtable 'table' contains the following:
table[1] = 1
table[2] = 2
table[...] = ...
table[Int32.MaxValue] = Int32.MaxValue
The following threads are now running against that same table
Thread 1:
for( int i = -1; i > Int32.MinValue; i-- )
{
table.Add( i, i );
}
Thread 2:
for( int i = 1; i < Int32.MaxValue; i++ )
{
table.Remove( i );
}
Thread 3:
while( true )
{
IList list = new ArrayList( table.Keys );
foreach( int number in list )
{
Console.WriteLine( number );
}
}
Obviously this is unusual, but it's something like what I actually have, and
I want to know whether or not this is thread-safe or if I need to provide
some synchronization. Thanks! Tag: How can i generate sample xml file with data from xsd schema? Tag: 102348
Posting values between pages
That ASP.NET pages post to themselves, how do pages share information
amoung themselves? As in, if my index.aspx has to post data to
nextpage.aspx, how does it happen? Is it left to the developer to
persist relevant control values in a state dictionary such as Session
and read them back in the target/destination page nextpage.aspx? Tag: How can i generate sample xml file with data from xsd schema? Tag: 102346
SocketException ???
Hi.
I have some quite unusual situation at which SocketException is thown while
connecting a socket. Generally the aim of application is processes data and
send results to a specified IPEndPoint. Since theres small amount of time
for processing and sending large amount of data it is logical to split whole
process in to few threads. One thread processes data and other sends it. The
problem occures when user sets too little time for doing that.
At first the thread works fine for about a minute or two, results are being
received on another machine event when the speed of whole process is
considered to be critical. And then just like that, exception
SocketException is thrown while connecting to an IpEndPoint with message
that might be translated as "It is usually allowed a single use of socket
address". As seen below socket is being shutdown and closed in the end. And
it seems like theres absolutely no reason for that exception to catch. Any
propositions? Thank you.
Error code of exception is 10048
private void Operate()
{
while (/*There is data to send*/)
{
Socket socket = null;
try
{
socket = new Socket(AddressFamily.InterNetwork,
SocketType.Stream, ProtocolType.Tcp);
socket.Connect(ipEndPoint);
<--------------------------------------------------------------------------Exception:
SocketException thrown here !!!!!!!!!!!!!
NetworkStream stream = new NetworkStream(socket);
BinaryWriter writer = new BinaryWriter(stream);
Scan[] scans = null;
lock (queue)
{
scans = queue.Dequeue() as Scan[];
}
for (int i = 0; i < scans.Length; i++)
{
writer.Write(scans[i].Azimuth);
socket.Send(scans[i].Data);
}
if (socket.Connected)
{
socket.Shutdown(SocketShutdown.Both);
}
}
catch (SocketException e)
{
msp.Engine.Paused = true;
if (MessageBox.Show(msp.Window,"Error occured:\n" + e.ToString()
+ "\n\nStop process?","Warning",MessageBoxButtons.YesNo) ==
DialogResult.Yes)
{
msp.Engine.Launched = false;
}
else
{
msp.Engine.Paused = false;
}
}
finally
{
if (socket != null)
{
socket.Close();
}
}
} Tag: How can i generate sample xml file with data from xsd schema? Tag: 102345
System.Threading.Monitor and SendMessage
This is a multi-part message in MIME format.
------=_NextPart_000_0009_01C5B066.058A4E30
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
We have an application written in c# that uses pinvoke to call =
SendMessage to send messages between threads. We also use Monitor class =
(via the c# lock keyword) for thread synchronization.=20
I have discovered the following behaviour, which surprised me:
0) Thread1 (T1) creates a NativeWindow, to be used as a SendMessage =
target, then calls Application.Run()
1) T1 enters an event handler
2) inside the event handler, T1 enters a lock region (calls =
Monitor.Enter), but blocks because another thread (call it T2) has =
entered
3) T3 calls SendMessage on the NativeWindow created by T1
4) The message handler for the message sent in 3) is run, while T1 is in =
the Monitor.Enter() call.
If I do the following experiment, I get different behaviour (code =
changes in bold)
0) Thread1 (T1) creates a System.Windows.Forms.Control, to be used as an =
Invoke target, then calls Application.Run()
1) T1 enters an event handler
2) inside the event handler, T1 enters a lock region (calls =
Monitor.Enter), but blocks because another thread (call it T2) has =
entered
3) T3 calls Invoke on the Control created by T1
4) T1 Monitor.Enter() returns (T2 called Monitor.Exit), and ultimately =
the event handler T1 is running returns
5) The delegate passed into Control.Invoke() in step 3) runs
The behaviour in the 2nd experiment is what I was expecting in the first =
experiments' case. It appears, in the first experiments case, that =
inside Monitor.Enter(), messages sent by SendMessage are being =
dispatched before it returns.
Does anyone have any idea what I can do, in the SendMessage case, to get =
the behaviour I am seeing using Control.Invoke()? I would rather not use =
Control.Invoke() because it has a couple limitations relative to using =
SendMessage() (but I may have to...)
Thanks for any insights any of you might have.
Craig Bryant
Senior Software Engineer
Tektronix, Inc
Beaverton, OR
------=_NextPart_000_0009_01C5B066.058A4E30
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2627" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>We have an application written in c# =
that uses=20
pinvoke to call SendMessage to send messages between threads. We also =
use=20
Monitor class (via the c# lock keyword) for thread=20
synchronization. </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I have discovered the following =
behaviour, which=20
surprised me:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>0) Thread1 (T1) creates a NativeWindow, =
to be used=20
as a SendMessage target, then calls Application.Run()</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>1) T1 enters an event =
handler</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>2) inside the event handler, T1 enters =
a lock=20
region (calls Monitor.Enter), but blocks because another thread =
(call it=20
T2) has entered</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>3) T3 calls SendMessage on the =
NativeWindow=20
created by T1</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>4) The message handler for the message =
sent in 3)=20
is run, <EM>while T1 is in the Monitor.Enter() call</EM>.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>If I do the following experiment, I get =
different=20
behaviour (code changes in bold)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>0) Thread1 (T1) creates a=20
<STRONG>System.Windows.Forms.Control</STRONG>, to be used as an Invoke =
target,=20
then calls Application.Run()</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>1) T1 enters an event =
handler</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>2) inside the event handler, T1 enters =
a lock=20
region (calls Monitor.Enter), but blocks because another thread =
(call it=20
T2) has entered</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>3) T3 calls <STRONG>Invoke on the =
Control</STRONG>=20
created by T1</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>4) T1 Monitor.Enter() returns (T2 =
called=20
Monitor.Exit), and ultimately the event handler T1 is running=20
returns</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>5) The delegate passed into =
Control.Invoke() in=20
step 3) runs</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>The behaviour in the 2nd experiment is =
what I was=20
expecting in the first experiments' case. It appears, in the first =
experiments=20
case, that inside Monitor.Enter(), messages sent by SendMessage are =
being=20
dispatched before it returns.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Does anyone have any idea what I can =
do, in the=20
SendMessage case, to get the behaviour I am seeing using =
Control.Invoke()? I=20
would rather not use Control.Invoke() because it has a couple =
limitations=20
relative to using SendMessage() (but I may have to...)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Thanks for any insights any of you =
might=20
have.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Craig Bryant</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Senior Software Engineer</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Tektronix, Inc</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Beaverton, =
OR</FONT></DIV></BODY></HTML>
------=_NextPart_000_0009_01C5B066.058A4E30-- Tag: How can i generate sample xml file with data from xsd schema? Tag: 102339
SqlException: Unknown Error
I have some code doing a very simple select "select bonusid from game where
gameid=@gameid" that works about 98% of the time, but somewhere around two
percent of the time it throws an exception. If I go through the sqlerror's
in the exception all it has is the following:
Index #0
Message: Unknown error.
LineNumber: 0
Source: .Net SqlClient Data Provider
Procedure:
Not very interesting is it. I've checked that the input is valid and I have
no problems running the same query manually. I also have yet to find a
consistent way to recreate this error but my clients are having no problems
doing it fairly frequently with no rhyme or reason that I can tell.
Although there are many clients simultaneously using the server they share
one database connection but I am very careful to only use the connection
through a wrapper class that Lock()'s the database connection. I'm really
lost on this one, has anyone else seen this? I could find next to nothing
on google/google groups.
Lloyd Christopher
SLOW30 Tag: How can i generate sample xml file with data from xsd schema? Tag: 102325
Debugging Problem
Hi all,
I am trying to debug an application developed by another developer. if i run
it in Debug mode(locally), the application hangs and does nothing (basically
dies and makes me wanna kill myself),... "does not reach the break point....
nada....." but if I try to run the application from another machine while
the application is under debug mode, it hits the break point.
Please advice,
Stephen Noronha Tag: How can i generate sample xml file with data from xsd schema? Tag: 102324
Enterprise Library really su#$%"#!"ks
Hello, long days these days than i had trying to setting up the Enterprise
Library Blocks in the production server.
Why? I will told you all my sad history, I had installed in my computer the
enterprise library of june with the ilussion than that will keep me away from
the database connections problems, scalability problems, and all that
things!, and I had tested that in my developer machine, and I dont had these
problems, but when I had started to setup the server, wow, what a
fu"#$%#$#$!"cking problem, the assemplies of the Enterprise Library doesn't
work. I had runned without results the installutil for each assembly, I had
compiled in command line the source code of these blocks in the server and i
dont had results, i had do everything possible (but not install the Visual
Studio 2003), and i dont have positive results.
Hey Microsoft guys, what is the problem with yours??, Keep it simple, why
the DAAB had worked so good, so easy, and with that enterprise library
everithing had changed, and you had send us a stupid problem.
For all you gouys, the problem than I got is that message error:
The type initializer for
"Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataConnectionFailedEvent" threw an exception. Tag: How can i generate sample xml file with data from xsd schema? Tag: 102322
SQL Server Mobile on Tablet PC
I'm trying to load data on a SQL Server CE database. Doing it on the Pocket
PC takes very long. I though I'd load it on the desktop using the tablet PC
API, using Visual Studio 2005 Beta 2 and Sql Server 2005 (Mobile).
I'm following instructions provided in the help file for Sql Server 2005 -
"Building a SQL Server Mobile Application for Tablet PCs". I'm having 2
problems.
1. I can't find "Microsoft Tablet PC API" under .NET assemblies, to add a
reference.
2. I did the rest - added "System.Data.SqlServerCe.dll" as a reference.
The application builds fine, but when it runs, it immediately stops with
this error:
System.IO.FileLoadException was unhandled
Message="Could not load file or assembly 'System.Data.SqlServerCe,
Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one
of its dependencies. The located assembly's manifest definition does not
match the assembly reference. (Exception from HRESULT: 0x80131040)" Tag: How can i generate sample xml file with data from xsd schema? Tag: 102321
Custom TransformerProvider in Configuration Application Block
Hello,
How can we create a custom TransformerProvider (deriving from =
XmlSerializerTransformer with some minor changes) and make it work with =
the Enterprise Library Configuration Application Block?
Thank you!
Best wishes,
Alex.
--=20
Address email to user "response" at domain "alexoren" with suffix "com" Tag: How can i generate sample xml file with data from xsd schema? Tag: 102319
regex result
is it OK to get regex result of pattern which has duplicate reference names
like
StrDatePattern As String
="\b(((?<year>\d{4})-(?<month>\d{1,2})-(?<day>\d{2}))|{(?<month>\d{1,2})
(?<day>\d{2}), (?<year>\d{4})))"?
my code segment
StrDatePattern As Sttring
="\b(((?<year>\d{4})-(?<month>\d{1,2})-(?<day>\d{2}))|{(?<month>\d{1,2})
(?<day>\d{2}), (?<year>\d{4})))"?
Dim strDate As Sttring = "", _
strYMD As Sttring = ""
Dim r as regex = New Regex(StrDatePattern , RegexOptions.IgnoreCase)
Dim m as match = r.Match(myStringHoldingDateInfo)
If m.Success Then
al_posn = m.Index + 1
strDate = Mid(StringIn, al_posn, m.Length) ' works so far
strYMD = m.Result("${year)-${month}-{$day}") ' at best, I
get the year component only
Else
al_posn = 0
strDate = ""
strYMD = ""
End If
I did not have much luck using match.result to re-arrange the extracted date
string. However I was able to extract the matched date string.
I even try with anoth match on strYMD and then use that result to re-arrange
the date string and still no luck.
What did do wrong?
thank you for your time.
I was Tag: How can i generate sample xml file with data from xsd schema? Tag: 102318
server side http for a non-web server
I'm evaluating using http to carry data between a client and a non-web
(C#) server application. This sounds great as the browser already has
an http implementation and http is an open protocol.
I was expecting to find a server piece that implemented the server side
without requiring a full web server. I've looked around and found
http.sys which sounded ideal but which doesn't seem have a C# API until
Framework 2.0. Is anyone aware of either some kind of a C++ wrapper for
http.sys or an alternate http implementation?
If not, I can fairly readily build a wrapper on top of existing TCP
functionality but I believe in reusing software when possible. I could
also introduce IIS and create an ASP.NET "proxy" that could take http
POSTS and relay them in the existing TCP format.
Thanks
Mike Tag: How can i generate sample xml file with data from xsd schema? Tag: 102317
asynchronous logging with enterprise library logging application block.
I am trying to use asynchronous logging using MSMQ and I have configured the
properties as defined in the help (see below) I don't understand where the
property 'MsmqPath' is in the app.config for MSMQDistrbutor.exe is it meant
to be an aplication settings or an enterprise library setting in the
app.config?
I have tried creating an application setting value for it but it still fails
to write to the logging destination?
Also is this meant to be registered as a service?
To choose asynchronous logging.
1.. In the Enterprise Library Configuration Console, expand Client
Settings, right-click Distribution Strategies, point to New and then click
MSMQ.
2.. Select the strategy and then specify the QueuePath for the strategy.
3.. Select Client Settings, and then modify the DistributionStrategy
property to select the MSMQ distribution strategy you created.
4.. Open the MSMQDistributor.exe.config file with the Configuration
Console, located in the directory containing the file MSMQDistributor.exe.
Modify the MsmqPath property of the MSMQ Distributor Service to match the
QueuePath property of the MSMQ distribution strategy you selected in step 2.
This distribution strategy will be used for all messages that are not
filtered out.
Note Do not use the In Process distributor strategy and the MSMQ
distributor strategy to log to the same flat file sink. Using both the In
Process and MSMQ distributor strategies with the same flat file sink may
result in simultaneous attempts to write to the same file. This will result
in failure due to the file resource being in use by another process.
Has anyone got any ideas?
I followed the instructions below to allow for an MSMQ not registered with
AD.
http://mvwood.com/blogs/blog/archive/2005/03/04/321.aspx
Cheers
Ollie Riches Tag: How can i generate sample xml file with data from xsd schema? Tag: 102316
Monitoring the existence of multiple files
What's the best way to monitor an arbitrary set of files? In a program like a
CD burning app, you've got a an explorer-like file system listview that you
pick your files from and a listview for the CD compilation. If you populate
the CD listview with 100 different files from 100 different folders, is there
a good way to monitor any changes to the files in that listview (deletions,
renames, moves, etc.)? This is mostly a GUI thing. I can easily check the
existence of the files just prior to performing any operations on them, but
I'd like to provide realtime feedback to the user so that they know when one
of the files they've chosen is unavailable.
I know there's the FileSystemWatcher class, but I suspect it's unwise to
create 100 FSWs, each monitoring one file per directory. Tag: How can i generate sample xml file with data from xsd schema? Tag: 102314
calling SQLLDR from C# (ASP.NET)
Hi, I'm trying to call SQLLDR from ASP.NET (C#) to load data from a
text file into a table.
I'm not a windows/microsoft person so if you could give me a hint I'd
appreciate it. I have tried a few ways to call sqlldr but it looks
like the line with sqlldr command is just not being executed... There
are no errors...
I was told that it very well might be a permissions issue but I'm not
sure where to look.
I can execute my bat file from a command line with no problems and it
works fine. Only from C# it doesn't work
Here are my code samples:
version 1:
---------------
String strRunCommand = "SQLLDR "+p_DbConnection+" data='"+
p_LoadSourcePath+strTxtFileName+
"' control="+strFileType+".ctl log="+strLogFileName+" SKIP=1 ERRORS=10
BINDSIZE=1048576";
System.IO.File.Create(p_LoadDestinationPath+"load_run.bat").Close);
StreamWriter sw = new
StreamWriterp_LoadDestinationPath+"load_run.bat");
sw.WriteLine(strRunCommand);
sw.Close();
System.Diagnostics.Process p = new Process();
p.StartInfo.RedirectStandardOutput=false;
p.StartInfo.FileName = p_LoadDestinationPath+"load_run.bat";
p.StartInfo.UseShellExecute = false;
p.StartInfo.WorkingDirectory = p_LoadDestinationPath;
p.StartInfo.RedirectStandardError = true;
p.Start();
p.WaitForExit();//wait with no time limit
p.Dispose();
---------------
version 2:
---------------
String strRunCommand = "SQLLDR "+p_DbConnection+" data='"+
p_LoadSourcePath+strTxtFileName+
"' control="+strFileType+".ctl log="+strLogFileName+" SKIP=1 ERRORS=10
BINDSIZE=1048576";
System.IO.File.Create(p_LoadDestinationPath+"load_run.bat").Close);
StreamWriter sw = new
StreamWriterp_LoadDestinationPath+"load_run.bat");
sw.WriteLine(strRunCommand);
sw.Close();
System.Diagnostics.ProcessStartInfo psi = new
System.Diagnostics.ProcessStartInfo("cmd.exe");
psi.UseShellExecute = false;
psi.RedirectStandardOutput = true;
psi.RedirectStandardInput = true;
psi.RedirectStandardError = true;
System.Diagnostics.Process proc =
System.Diagnostics.Process.Start(psi);
System.IO.StreamReader strm =
System.IO.File.OpenText(p_LoadDestinationPath+"load_run.bat");
System.IO.StreamReader sOut = proc.StandardOutput;
System.IO.StreamWriter sIn = proc.StandardInput;
while(strm.Peek() != -1)
{
sIn.WriteLine(strm.ReadLine());
}
sIn.WriteLine("EXIT");
proc.Close();
sIn.Close();
sOut.Close();
--------------- Tag: How can i generate sample xml file with data from xsd schema? Tag: 102304
thread.abort and thread.suspend
Hi to all.
I have a little problem. I'm working with threads, and I need to abort
or suspend them, but many experts dissuade from use Thread.Abort and
Thread.Suspend. As I didn't find other way, how can I do?
Thanks a lot! Tag: How can i generate sample xml file with data from xsd schema? Tag: 102289
How to control order of properties in a class
Hi,
I have created a class with some properties
Class Manager
Private msName a s string
Private msSurnaname as string
Private mdSalary as double
Public Property Name() as string
.....Implementation
....Similarly implemented all the properties
...Some functions
End Class
To make class bindable I created a custom collection class
Class Managers
Inherits CollectionBase
Public Function AddManager() as Manager
'implementation code....
End Function
Public ReadOnly Property Item(byval index as integer) as Manager
'implementation code....
End Property
End Class
When I create instance of Managers class and added some manager objects to
it. I tried to bind this to a third party grid (Data grid wont bind). It
worked..But my problem is how I can control order of properties in columns.
I see Columns in Surname, Name, Salary order...What should I do to ensure
that my columns come in Name, Surname abd Salary order?
I wonder How dataset achieve this? In dataset you'll always se fields in
same order as they appear in XSD schema..Is there any way to achive this
functionality?
Thanks,
Abhishek
jain_abhishek_77@yahoo.co.in Tag: How can i generate sample xml file with data from xsd schema? Tag: 102285
Networking program to send multiple files for multiple clients
hi
I'm writing a small windows service for sending multiple files for multiple
clients when the request is got from the client . i need suggestion to
implement this concept
would you prefer multiple ports to be used to send the files at a time to
the requested clients using multithreading? Tag: How can i generate sample xml file with data from xsd schema? Tag: 102282
processModel/memoryLimit Windows Service
Can anyone tell me does the memoryLimit attribute in the machine.config
also affect Windows Services. I know this does apply to ASP.NET
applications, but I am unsure for Windows Services.
Thank you Tag: How can i generate sample xml file with data from xsd schema? Tag: 102278
Store date permanently
Hi, I'm writing an activation system for a software, which allows a 15 days
grace period. Now the question is... how can I store the date? It has to be
kept even if the software is reinstalled, and it must not be too easy to
find/delete. I could write a hidden file somewhere in the system or hide it
in the registry, but if it is a limited XP account, I'm quite limited. Any
genious idea!? I tried Isolated Storage, but just moving the assembly files
creates a new Isolated Storage, so it's of no use.
Thanks!
Etienne
Getting a beta version out soon... Tag: How can i generate sample xml file with data from xsd schema? Tag: 102268
.NET versions forward compatibility
I posted this originally in
microsoft.public.dotnet.framework.windowsforms -- but this is probably a
better place...
I am developing with VS 2003 -- .NET framework 1.1
I want my app to also run on .NET framework 1.0, so I define a .config file
with the following:
<configuration>
<startup>
<supportedRuntime version="v1.1.4322" />
<supportedRuntime version="v1.0.3705" />
</startup>
</configuration>
As a test, I am doing this on a plain-vanilla Windows app -- with a single
form and a single textbox.
But it does not work, on a .NET framework 1.0.
Is there a way to debug a config file? Where should I look to make progress? Tag: How can i generate sample xml file with data from xsd schema? Tag: 102265
Web Service Always returns 404
Hi,
I'm using VS2005 beta 2 to make an asp.net web service.
When I try to run any webservice (even a helloworld example) I get a 404
error:
Server Error in '/QNSEmulator' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its
dependencies) could have been removed, had its name changed, or is
temporarily unavailable. Please review the following URL and make sure that
it is spelled correctly.
Requested URL: /QNSEmulator/Service.asmx
Version Information: Microsoft .NET Framework Version:2.0.50215.44; ASP.NET
Version:2.0.50215.44
It started happening when i was trying to publish the website somewhere else
on my local machine using the Build>>Publish ... thing. Does anyone know how
i can fix this? Will uninstalling and reinstalling VS do anything? Tag: How can i generate sample xml file with data from xsd schema? Tag: 102264
Creating the Double2 type
Hi,
I have some problems with the default rounding method of C#
check an earlier post of my :
http://groups.google.be/group/microsoft.public.dotnet.framework/browse_frm/thread/12ed0c44b2ffbddf/a410c5e788c35f06?l=nl#a410c5e788c35f06
To create a workaround for this problem, I wan't to create my own
double type !
the 'Double2' would act like a standard double but when assinging a
value to it, it will always my own rounding method to round the value
to 2 decimals.
Double2 d = 1.235;
d -> 1.23;
How can I create my own type like this ?
Kind regards
Frank Vandelinden Tag: How can i generate sample xml file with data from xsd schema? Tag: 102260
Banker's Rounding by default, a big mistake !!
Check the following example: it's a simple presentation of a ticket.
double[] lines = new double[5];
//Set some VAT's
lines[0] = 1.245;
lines[1] = 1.246;
lines[2] = 1.241;
lines[3] = 1.275;
lines[4] = 1.255;
//Print and calc total
double tot = 0;
foreach (double val in lines) {
tot += val;
Console.WriteLine(" {0:0.00}", val);
}
Console.WriteLine("-----");
Console.WriteLine(" {0:0.00}", tot);
Console.ReadLine();
This is the result :
1,25
1,25
1,24
1,28
1,26
--------
6,26
Now take our your calculator (or excell if you like) an add the 5 lines
manualy !
Your result wil be 6.28. -> 0.02 difference !!!!!!!!!
If I give this ticket to a client he demands to now where the 0.02 euro
has gone to.
I know this has to do with the way C# round's its doubles (it is using
the Banker's Rounding method)
What i don't understand is why it's the default.
To put it simple :
How do I explain to someone (that is not a computer wiz),
that 1 + 1 = 1.1 ????
Kind Regards
Frank Vanderlinden Tag: How can i generate sample xml file with data from xsd schema? Tag: 102256
web.config file
hi
i have a web.config file that specifies the connection string for my
database. the database server on the ISP is using a different port than
1433. how do i specify in the connection string to use a specific port
number?
i tried the <ip address>:<port number> and that didn't work.
any ideas?
thanks Tag: How can i generate sample xml file with data from xsd schema? Tag: 102251
Q re class layout with embedded structs
A friend and fellow programmer asked, and I didn't know the answer:
When a CLR class contains fields of non-scalar types (structs, say), are
these structs then laid out in memory immediately within the class instance
image, or are they converted implicitly into reference types and only
references to instances of these stored in the class instance? According to
him, the reflection APIs leave the impression that the latter takes place,
whereas the SOS documentation suggests the former. To clarify, I'm referring
to fields of types that are not usually reference types (structs) as opposed
to arrays and strings that are of course always stored by reference.
TIA
- Per Tag: How can i generate sample xml file with data from xsd schema? Tag: 102250
Bulk Import - Thread was being Abort
I am facing a unique problem where i am reading
an XMl stream(8000 records) using open XML into SQL server > The problem is
that whenever i execute the stored procedure it starts inserting data but
suddenly stops at about 1 min 45-50 secs time. The import stops and the
error is
"Thread was being aborted". The whole stuff works fine when i connect to the
database server from local machine.
The database server is located at a remore place and the live application
resides in the same place as of the database server. I get this problem when
i try doing import logging in to the live server. i dont get this problem
when i try doing this locally to the remote database server
Settings : IIS6.0 and ASP.NET, SQL Server
please suggest if there are any web server based settings which are forcing
the import to time out.
Arnab Kumar Dutta
Associate-Technology
BMS Team
D03044 Tag: How can i generate sample xml file with data from xsd schema? Tag: 102247
Compiler disallows for loop in ASPX ... what's up?
Hi All,
In effort to write a loop in ASPX to generate a set of labels, I tried this:
<form id="Form2" method="post" runat="server">
<script language="C#" runat="server">
int nCols = 8;
int nRows = 20;
int iHeight = 25;
int iWidth = 50;
int iVertGap = 5;
int iHorGap = 5;
for (int iRow=0; iRow<nRows; iRow++)
{
<asp:Label ID="Lbl" RunAt="server" />
[snip]
intending to assign values to the properties of the Lbl object. But the
compiler announced:
CS1519: Invalid token 'for' in class, struct, or interface member
declaration
What can I do to generate a bunch of object programmatically in ASPX?
Thanks in advance,
Richard Tag: How can i generate sample xml file with data from xsd schema? Tag: 102244
Cannot receive data across socket connection by .NET app
I have a .NET app that connects to a third-party server on a socket and sends
data. This works with a test server on the local network, but does not work
across the frame connection to the third-party server. They see a connection,
but never see any data coming across.
This works with Win32 app using winsock.
However, if I use [DllImport] and call a Win32 dll that uses Winsock from my
.NET app, it does not work.
Is there some setting in .NET framework security or my code that I am missing?
Any ideas?
Thanks Tag: How can i generate sample xml file with data from xsd schema? Tag: 102241
AppDomain unloading problem
Hi,
I have a main assembly (assy1). That assembly creates a type in another
assembly (assy2). That type creates an AppDomain, load it's parent assembly
(assy2) into it and creates a type in the AppDomain.
Problem: when I call AppDomain.Unload(_myAppDomain), the application just
crash. No exception, no message box. Nothing. Just a plain old "native days"
type of crash...
I really have difficulties understanding what is happening. What I'm doing
is the simplest of all the AppDomain usage scenario, and yet it crash my
application...
Any idea? Tag: How can i generate sample xml file with data from xsd schema? Tag: 102236
ReaderWriterLock acquire timeout values ???
According to the documentation for the Acquire methods on the
ReaderWriterLock class:
-1 Infinite.
0 No time-out.
> 0 The number of milliseconds to wait.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemthreadingreaderwriterlockclasstopic.asp
Does someone want to explain to me the difference between -1 (infinite)
and 0 (no time-out)???
I've been using 0, but occasionally get a time-expired exception that
traces back to an attempted acquire ??? I thought 0 was /not/ supposed
to time out.
I've switched to Timeout.Infinite (-1) to see if that fixes the problem.
Regardless, I'd like to know the difference(s) between the two values. Tag: How can i generate sample xml file with data from xsd schema? Tag: 102235
Create Access Database with ADOX
I'm using asp.net referencing ADOX to create access database on server side.
Using C#;
Two problems:
the ASPNET process doesn't let go of the access file, so I can't access it
after I've created the file. I've set the ADOX.CatalogClass variable to
null, but it doesn't let go of it...is there a connection close command?
second problem, with one of my table create, I have a access YES/NO field.
when I have:
tableClients.Columns.Append("fldField" + i,DataTypeEnum.adBoolean,0);
then later on:
cat.Tables.Append((object)tableClients);
it gives me:
"Multiple-step OLE DB operation generated errors. Check each OLE DB status
value, if available. No work was done. "
else if I don't append that column, it runs fine.
what's wrong??
Thanx Tag: How can i generate sample xml file with data from xsd schema? Tag: 102231
NDoc not working
How coul I resolve the following error with NDoc. Note I did add in NDoc
comment to some private/protected method and in the NDoc Project, I did
specify Document{Internals,Privates,Protected} to True
An error occured while trying to build the documentation.
Exception: NDoc.Core.DocumenterException
There are no documentable types in this project.
Any types that exist in the assemblies you are documenting have been
excluded by the current visibility settings.
For example, you are attempting to document an internal class, but the
'DocumentInternals' visibility setting is set to False.
Note: C# defaults to 'internal' if no accessibilty is specified, which is
often the case for Console apps created in VS.NET...
Exception: NDoc.Core.DocumenterException
There are no documentable types in this project.
Any types that exist in the assemblies you are documenting have been
excluded by the current visibility settings.
For example, you are attempting to document an internal class, but the
'DocumentInternals' visibility setting is set to False.
Note: C# defaults to 'internal' if no accessibilty is specified, which is
often the case for Console apps created in VS.NET...
Stack Trace:
Exception: NDoc.Core.DocumenterException
at NDoc.Documenter.Msdn.MsdnDocumenter.Build(Project project)
at NDoc.Gui.BuildWorker.ThreadProc()
Exception: NDoc.Core.DocumenterException
at NDoc.Documenter.Msdn.MsdnDocumenter.Build(Project project) Tag: How can i generate sample xml file with data from xsd schema? Tag: 102230
custom logging sink for logging application block
I have written a custom logging sink for the enterprise library logging
application block (June 2005). I have been able to configure it as expected
from the UI config tool (EntLibConfig.exe).
I have built a console application to test it with and I am getting the
following error message write to the default trace log when I attempt to use
my custom logging sink.
'An error occurred while the Distributor was processing the message. Please
check your configuration files for errors or typos. Verify that your sinks
are reachable (queues exist, permissions are set, database exists, etc...)'
This might be security related can anyone give me the answer on how to fix
this?
I can see from VS that the module for my custom logging sink is loaded at
runtime but I am unable to break into the assembly which indicates to me
that any of the 'LogSink' overridden methods are not being called.
Cheers
Ollie Riches Tag: How can i generate sample xml file with data from xsd schema? Tag: 102229
strong name using al.exe and csc.exe
I'm very much a beginner with C# and the .NET Framework environment,
and am writing and building C# programs using the command line CSC.EXE
compiler. What I'm trying to do now is try out some of the evidence
options and the security policy settings.
Code Signing and using this via certificates and Publish evidence is
working fine, but I'm a bit stumped by strong naming at the moment.
I've created a key pair using sn.exe, and read that I sign with this
to an assembly before it's built (so not to a completed .exe).
This seems to be the way to go from what I've read:
AL.EXE /out:testapp.exe testapp.netmodule /keyfile:keypair.snk
So far I've been using /target:winexe in CSC.EXE, so don't have the
module files AL.EXE wants. I tried changing the CSC.EXE command line
to:
CSC.EXE /target.module /reference:... testapp.cs
This allowed AL.EXE to complete without error messages, but the
resulting .EXE says it's not a valid Win32 executable.
Can anyone point me in the right direction to getting a valid Win32
executable that is strong named, using only the command line tools of
the SDK?
Danny. Tag: How can i generate sample xml file with data from xsd schema? Tag: 102223
Math.Round
Hi,
C# uses Banker's Rounding to round decimals
1.75 -> 1.8
1.65 -> 1.6
How can I disable this Banker's rounding !!!
I would prefere that when the double ends on 5, it gets roudend up
(ignoring even/odd numbers)
1.75 -> 1.8
1.65 -> 1.7
Kind Regards
Frank Vanderlinden Tag: How can i generate sample xml file with data from xsd schema? Tag: 102221
Relfection and assmelby build date
How could I use relfection or another mean to fetcth the DLL's modification
date? Tag: How can i generate sample xml file with data from xsd schema? Tag: 102218
WSE TIME synchronisation between server and client machines
Hi friends,
I am stuck with a problem. I have a ASP.NET(C#) based web service program
which
acts as the server program and a client program, both the programs residing
at different locations. I am passing parameters using WSE methods, from
client program to server program and viceversa.
Say for ex, the server program has the system time of 10:00 AM and the
client program has the system time of -5 hours to the server program. now,
when i want to login to my client program, i have to pass on my username and
password to the server program. In doing so, since there is a time difference
of -5 hours, and i get back an error saying "Creation time can not be in the
future".
I put up the following code at the server program to resolve this issue..but
it is giving syntax errors.
<configuration>
<microsoft.web.services2>
<security>
<defaultTtlInSeconds>86400</defaultTtlInSeconds>
<timeToleranceInSeconds>86400</timeToleranceInSeconds>
</security>
</microsoft.web.services2>
</configuration>
Please let me know if there are any other methods to resolve this problem or
any other configuration settings to be done!
Thanks,
Indiresh. Tag: How can i generate sample xml file with data from xsd schema? Tag: 102213
code generation tool
My company is thinking of using a code generation tool to generate DAL
classes, Typed DataSet, Entity Objects, as well as basic WebService to
access the DAL classes.
As we do not have much experience about these kind of tool here, I would
like to ask someone if they know any professional and reliable tool for
that. I have heard of CodeSmith but I don't know if there are any other
better / more complete tool. The cost is not an issue. The real issue is to
find out one of the best tool on the market as once we would start to use it
we would stick to it for the all enterprise application.
If anyone of you as an idea of what are the best tools around then please
let me know.
Best,
Francois Malgreve Tag: How can i generate sample xml file with data from xsd schema? Tag: 102202
Problem Security
Hello.
I use a web service that I created through a custom
control on a windows form and it works fine. However, if iput this control
on a
webform, i get an security error when i
call the web service
saying:
"The application attempted to perform an operation not
allowed by the security policy. The operation required the
SecurityException. To grant this application the required
permission please contact your system administrator, or
use the Microsoft .NET security policy administration tool.
Request for the permission of type
System,Net.WebPermission..."
What can i do?
I don't know how to explicitly trust the assembly.
Thanks Tag: How can i generate sample xml file with data from xsd schema? Tag: 102200
Problem coding logic in a webform
Hi All,
I used VS.Net to build a webform app. I used the toolbox to drag a bunch of
labels onto a form to form a matrix.
In the HTML code I saw a bunch of <asp:label ...> lines with various LEFT:
xxx and TOP: xxx values.
I want to tear them out and replace them with some script that looks
something like this (ignoring all the other generated parameters beside the
LEFT and TOP parameters:
<script language="C#" runat="server">
int nCols = 8;
int nRows = 20;
for (int iRow=0; iRow<nRows; iRow++)
{
int iRowOffset = 10+35*iRow;
string sRowOffset = iRowOffset.toString + "px";
for (int iCol=0; iCol<nCols; iCol++)
{
int iColOffset = 15+80*iCol;
string sColOffset = iColOffset.toString + "px";
<asp:label COL: sColOffset TOP: sRowOffset>
}
}
</script>
Can you point to a WebForm coding sample that has real, working code that
has any elements relating to my pseudocode?
Thanks in Advance,
Richard Tag: How can i generate sample xml file with data from xsd schema? Tag: 102190
Connection as a static class
Is it alright if I took a static class that wrapped around a
SQLConnection object on a web application? Or should I make it an
instance class?
If I have a static class, would there be just one code instance of the
class in the server process/app domain for all the clients/browsers?
So, if a page on a particular request/context does a
MyConnectionClass.Close() in its Unload event handler for the Page,
would this close the connection for all clients if it were implemented
as a static class? Tag: How can i generate sample xml file with data from xsd schema? Tag: 102187
*this* keyword
Does the *this* keyword refer to the class or the instance? Tag: How can i generate sample xml file with data from xsd schema? Tag: 102185
Debugging issue
Hi,
Is there a way of debugging a web application other than hitting F5 on VS
.NET.
I have a box that has less RAM and the bloody application dies on me. it
makes me put my hair.
I want to debug my application to check whether my application is taking
correct values.
Thanks,
Stephen Tag: How can i generate sample xml file with data from xsd schema? Tag: 102172
How can i generate sample xml file with data from my xsd schema?