Instantiate object with private constructor
It is not possible to create an instance of a
System.Data.SqlClient.SqlDataReader because it's constructor is Private.
But somehow the ExecuteReader method of SqlCommand manages to create a
reader object.
How is this acheived because I want to emulate this sort of behaviour?
Thanks in advance. Tag: Use MDB file on machine where Office Tag: 74496
Upgrading to .net Framework 1.1
Hi!
I am currently using Microsoft Visual Studio 2002 with .net framework 1.0
How can i upgrade to .net framework 1.1 Tag: Use MDB file on machine where Office Tag: 74493
Another Bug in SqlDecimal Round?
There is a rounding error fix in SqlDecimal roun
http://support.microsoft.com/default.aspx?scid=kb;en-us;83942
but I found this to be an error as well, can someone confirm this and is there a fix for it
tr
decimal Result = 0m
decimal rate = 0.155m
for(int i = 0; i < 31; i++)
Result += System.Data.SqlTypes.SqlDecimal.Round(((rate /365m) * 6018.2m), 4).Value;
Result = System.Data.SqlTypes.SqlDecimal.Round(Result, 2).Value
catch (Exception ex
Console.WriteLine(ex.Message) Tag: Use MDB file on machine where Office Tag: 74478
How to add events to dynamic contextmenu ?
Hi
I am looking for some help in adding events to dynamic contextmenu.I want to rise the click event for each of the menu ite
that I am creating.
Below is my code for adding dynamic context menu
System.Windows.Forms.MenuItem MnuItem
MnuItem= new System.Windows.Forms.MenuItem()
MnuItem.Text = comboBox1.Text;
cmFavorites.MenuItems.Add(cmFavorites.MenuItems.Count,MnuItem)
can someone help me with the sample lines of code ,how to add the events for the dynamic menu
Thanks for your help in advanc
Priya Tag: Use MDB file on machine where Office Tag: 74474
Threads
Hi
I have an aplication made with C#. It executes stored procedures using threads. I threw a thread and it executes the store. I want to kill it, but I don't kwon if I procesess executed by the thread, stops too.
For example:
I threw a thread and it begins to execute the stored called TEST1, then I kill the thread.
Do I stop TEST1's execution? I say NO, but I'm not sure.
Does someone help me?
Thanks Tag: Use MDB file on machine where Office Tag: 74473
Can DataTable's Select or Compute do Count(Distinct())
I have a single DataTable in a DataSet. It has 4 columns and i'd like to
get a handful of counts of unique items in 3 of the 4 columns.
Can a DataTables Select or Compute methods to COUNT DISTINCT?
These two attempts failed
DataRow[] dr = ds.Tables[0].Select( "COUNT(DISTINCT(site_name))" );
object x = ds.Tables[0].Compute( "COUNT(DISTINCT(site_name))",
"ProductionCount > 0" );
The filter in the Compute I don't really want because I'd like to count
distinct on all rows..but the method forces me ot have a filter expression
thanks
mike Tag: Use MDB file on machine where Office Tag: 74468
Signing and dependencies?
As per recommendation we run our assemblies with delay signing then just before we package we fully sign the assemblies then package into a setup (msi) file.
The problem that we are running into is that the project that packages up the files to go into the msi file seems to detect that something is out of date and kicks off another build our link which destroys the fully signed assembly(s). I have two questions. One, how do I determine the right dependency so that the link will not occur? Isn't there a better way like forcing a sign just before the assembly goes into the package (msi)? I have tried to sign in the same order as the dependency list within Visual Studio but that doesn't work. Two, how do I tell if a file or assembly is fully signed versus partially signed?
Thank you for your suggestions.
Kevin Tag: Use MDB file on machine where Office Tag: 74466
IsNaN throwing exception
Hi all
An ArithmeticException is being thrown when I call Double.IsNaN() on a double whose value is NaN. The text of the exception is:
"A first chance exception of type 'System.ArithmeticException' occurred in mscorlib.dl
Additional information: Overflow or underflow in the arithmetic operation.
This bug is hard to reproduce, but once and a while I get an unhandled exception, and Double.IsNaN() is the culprit. And when it does happen, even if I handle that exception in that location, it seems like every other call to Double.IsNaN() now throws the exception when the parameter value is NaN. Also, all of the projects in my solution have the "Check for Arithmetic Overflow/Underflow" option set to false
Does anyone know what conditions cause Double.IsNaN() to throw this exception
Thanks in advance for any help on this matter
Sincerely
Jonathan DeCarl Tag: Use MDB file on machine where Office Tag: 74462
Server handling of HTTP Get
New to .Net but not VB. If someone could point me in the general direction of where to look. Need to develop an application running on a server that can accept a HTTP Get, create a text file dynamically, and return the text file via HTTP. Do I need to be using HttpWebRequest and HttpWebResponse? Does anyone know of any samples showing this? Thanks. Tag: Use MDB file on machine where Office Tag: 74461
WMI SQL Queries with Joins
In the samples I saw with WMI, we can use a SQL like query to get system information ( "Select * From SomeWMIClass" ).
Can I use joins to get WMI classes correlated data ??
For example: I want to join Win32_NetworkAdapter with Win32_NetworkAdapterConfiguration to get a result set with information from the two classes in a single resultset.
How to join multiple WMI classes ??
Something like this
Select Win32_NetworkAdapter.AdapterType, Win32_NetworkAdapter.Caption, Win32_NetworkAdapterConfiguration.IPAddress, Win32_NetworkAdapterConfiguration.MACAddress
From Win32_NetworkAdapter, Win32_NetworkAdapterConfiguration
Where Win32_NetworkAdapter.ID = Win32_NetworkAdapterConfiguration.ID ( ??
Thanks. Tag: Use MDB file on machine where Office Tag: 74460
Can I have SelectionMode be None in a CheckedListBox? - getting errors.
I have a CheckedListBox that is bound to a DataTable, and has a
description field as it's DisplayMember.
I can't figure out how to have the Selection Mode be "None" w/ this.
I keep getting errors. Does anyone know how to do this?
I've also tried to use the SetSelection sub under the listbox, to
de-select a selected item, but I got errors there too.
Any ideas?
Thanks... Tag: Use MDB file on machine where Office Tag: 74459
OdbcConnection : concurrent transaction, IsolationLevel
Hello ,
I need help to How I Can serialize Query with .NetFramework
and Odbc SQLServer Connection ...
I want that :
1. Client A read "name,lastname" from query
2. Client B try to read "name,lastname" but .Net must block the query
3. Client B is waiting that client A have release the block
4. Client A update "name,lastname"
5. Client A close the transaction
6. Client B read "name,lastname" and exit from Block "state"
7. Client B is happy :-))
How I can do it ?!
OdbcTransaction can allow me to do it ?!
thank all
Hakù Tag: Use MDB file on machine where Office Tag: 74458
GAC and the .NET IDE
I have done a lot of poking around on the newsgroups trying to find a
good explanation as to why I have to take the extra step of making a
registry entry in order for the .NET IDE to show my registered GAC
assemblies. I understand technically why they don't show up but why
wouldn't we want them to? Can anybody give me an acceptable reason
why I might 'not' want to see the entire list of GAC assemblies in my
'Add Reference...' dialog? Why isn't the 'Add Reference...' function
smart enough to pull the entire GAC?
thanks,
Sean Tag: Use MDB file on machine where Office Tag: 74455
Threading and callback problem
Hi,
I'm trying to do this :
1) Start a new thread called "FillingThread" from my main thread
2) when my FillingThread is finnished, I wan't the main thread to be
notified.
But I don't see anyway to call a function in the main thread from the
"FillingThread" thread.
If any one got an idea ...
I'm just trying to be notified in the main thread that the
"fillingThread" is finnsihed without any hack such as a loop while
thread not finished...
Note that I DO wan't to use Thread because I need to be able to cancel it.
Thx in advance ! Tag: Use MDB file on machine where Office Tag: 74452
Sockets / Remoting / Web Service ?
Hi,
I'm architecting a solution that will collect a lot of data from client machines via WMI. I will install an agent ( client software ) that will comunicate with a server software. The server can list all active agents, and find send a request to update the client machine data. Then this agent will invoke several WMI enabled routines and collect all necessary data. Then this agent will need to send this data via a stream to the server. The server will processes this data and update the database.
What's the best form to perform this client \ server comunication ? Via network sockets, via .net remoting or via web services
This solution is intended to be used in local intranets. But in some cases I will need to send this data via internet.
The software will use ASP.NET technology as the frontend.
Thanks
Lucas Ponzo Tag: Use MDB file on machine where Office Tag: 74446
.NET Compatibility
1) Does .NET framework ship standard on certain versions of Windows?
2) The reason for the question is that I wrote an internet explorer browser helper object in C# using Visual Studio 2003. Since I used .NET, which versions of Window can I run it on?
3) Do my users have to install the .NET framework to run my browser helper object? Tag: Use MDB file on machine where Office Tag: 74433
break statement
How could I break out of the while loop within the for/if loop below
while (intCurCategory < intTotalCategories)
{
for (intPageIter = 0;intPageIter< ITEMS_PER_PAGE;intPageIter++)
{
if (intPagesDisplayed>ITEMS_PER_PAGE)
break; //trying to break out of the while loop here!
intPagesDisplayed++
}
} Tag: Use MDB file on machine where Office Tag: 74432
Internet Mail Integration
I would like to build or work in a simple internet mail program into my
application for the hopes of passing some of the from, subject and sent
time fields to a database.
Any links or help appreciated.
Thanks,
Steve
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it! Tag: Use MDB file on machine where Office Tag: 74430
connect to SQL server: windows authentication / SQL Server authentication
I have install a while ago a SQL server on my home computer.
now, due to my work, I'm more confident with it and want to play around with
it at home.
I try to make a connection string to it and I keep having error:
---------------------------
SQL Query Analyzer
---------------------------
Unable to connect to server HERMES:
Server: Msg 18452, Level 16, State 1
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user
'lloyd'. Reason: Not associated with a trusted SQL Server connection.
---------------------------
OK
---------------------------
I try play around with user role, etc ... in SQL Enterprise manager, no way
I manage user lloyd to work.
this drives me crazy, how could I connect to this database.
(apparently windows authentication work, but I DON'T want to use it, I want
to use a login/password !)
BTW I was wondering, I don't really understand how windows authentication
work, nowhere I manage to find the right granted to myself or user ASP_NET,
where could I find that ? Tag: Use MDB file on machine where Office Tag: 74426
ANSI 4010
Hi,
I want the code in VB.Net to convert text files to
ansi 4010 format.
--------------------------------
From: praveen nayak
-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)
<Id>OjxPTtA9B0Gd9gWF6+bujA==</Id> Tag: Use MDB file on machine where Office Tag: 74425
ASP.NET and SSL
English:
Hi! I have a problem when I send a request from an asp page to another
with HttpWebRequest. The site requires a certicate to access, for
this reason I added a certificate to the request using the class
X509Certificate. The problem is that I get a 403 forbidden error
message. I guess that is a permission matter. I also tried to create
a component service to do it, but I obtain the same error message.
You have the code here, thanks in advance.
Spanish:
Hola! Tengo un problema al enviar una petición de una página asp a
otra con HttpWebRequest. El sitio requiere de certificados para poder
entrar, así que a la petición le añado un certificado para que me
permita abrir la página asp. El problema es que me da un error 403 de
prohibido. Supongo que será por algún tema de permisos pero no se
solucionarlo. También he intentado crear un servicio de componente
que lo haga, pero me da el mismo error. Aquí os dejo el código para
ver si le podeis echar un vistazo.
The code:
Dim datos, respuesta As String
Dim webReq As HttpWebRequest
Dim webResp As HttpWebResponse
Dim sw As Stream
Dim sr As StreamReader
Dim encodedData As New ASCIIEncoding
Dim byteArray As Byte() = encodedData.GetBytes(datos)
webReq = HttpWebRequest.Create(url)
webReq.Method = "POST"
webReq.Timeout = 60000
webReq.ContentLength = byteArray.Length
webReq.ContentType = "application/x-www-form-urlencoded"
Dim cert = X509Certificate.CreateFromCertFile(pathcertificado)
webReq.ClientCertificates.Add(cert)
webReq.AllowWriteStreamBuffering = False
sw = webReq.GetRequestStream()
sw.Write(byteArray, 0, byteArray.Length)
sw.Close()
'Obtenemos la respuesta del servidor
webResp = webReq.GetResponse()
sr = New StreamReader(webResp.GetResponseStream())
respuesta = sr.ReadToEnd()
sr.Close()
Gracias. Thanks Tag: Use MDB file on machine where Office Tag: 74422
Disabling network adapter
Hi
Can I disable a wireless network adapter with som dll functions or C# code
??
regards Tag: Use MDB file on machine where Office Tag: 74421
CS0006: Metadata file could not be found
Hi all,
I've been happily developing an asp.net application for several months
now that uses the data and exception management application blocks.
All was fine until I tried to run the app in debug this morning and
got the following :
Compiler Error Message: CS0006: Metadata file
'c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net
files\wso\c6edba50\cef3a07\assembly\dl2\8b3cbee0\005ab7a3_8112c401\microsoft.applicationblocks.exceptionmanagement.interfaces.dll'
could not be found
I've removed the references to the block dlls and put them back in,
I've checked that index server is disabled, and I've rebooted and
tried again... all without success.
I'm a bit baffled as this worked fine yesterday, and nothing has
changed between then and today other thatn the machine had been
rebooted this morning the same as it is every morning...... Any
ideas??
Many thanks
Pete Baugh Tag: Use MDB file on machine where Office Tag: 74420
Problem with windows services created through .Net
Hi guys/gals
I had created a service in .Net. The name of the service is VCSService.exe. This VCSService.exe is in turn is calling another exe called as VCSFiles.exe. The exe VCSFiles.exe is displaying the windows DOMAIN NAME and the USER NAME of the system. I am running windows 2000. Let us say my DOMAIN NAME is "SEMANITCINDIA" and the USERNAME is "hitesh vibhakar". The same result i am able to get when i execute my VCSFiles.exe directly. But when i am calling this exe through my service ie. VCSService.exe, it is displaying the DOMAINNAME as "NT AUTHORITY" and USERNAME as "SYSTEM". During the creation of my service, the account type, i had specified is "LOCAL SYSTEM" and my service is an interactive service
So what is the reason for this problem. ie. why my service is showing the different domain name and username ? as it is affecting my further manipulation in the VCSFiles.exe. Plz provide a solution regarding this problem at the earliest. Tag: Use MDB file on machine where Office Tag: 74410
SerialPort
There is a SerialPort sample on gotdotnet which seems to originate from Microsoft, and is described as being "similar to what we will be adding in a future version of the Framework"
http://www.gotdotnet.com/community/usersamples/Default.aspx?query=SerialPor
Compatibility with a future version of the framework is a compelling reason to use this component, but the comments on gotdotnet indicate that the component has a number of apparently serious bugs. Are there any plans to release an update to clear some/all of these bugs
Thanks
Joe Tag: Use MDB file on machine where Office Tag: 74409
New Project
The explorer for a new project only shows me Visaul Basic, Setup and "other" projects. But in "other" projects I only can find a Blank Solution
I'd like to start a C# project but it is not possible even though .NET Enterprise architect is fully installed.
How can I link c# and Help projects to this "New project" explorer?
Thanks in advanc
Robert Haerle Tag: Use MDB file on machine where Office Tag: 74404
Faxing
This is a multi-part message in MIME format.
------=_NextPart_000_0008_01C4334F.6BB03700
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Does somebody know why the foolowing code
throws an System.Runtime.InteropServices.COMException exception with =
the message of 'Unspecified error'?
FaxServerClass fxsvr =3D new FaxServerClass();
fxsvr.Connect(""); // null for local fax server otherwise a computername
I use the FAXCOMLib library under Windows 2000.
Thanks,
Mircea
------=_NextPart_000_0008_01C4334F.6BB03700
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.2800.1400" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>Does somebody know why the foolowing=20
code</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>throws=20
an System.Runtime.InteropServices.COMException exception with =
the=20
message of 'Unspecified error'?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<P><FONT face=3DArial size=3D2>FaxServerClass fxsvr =3D new=20
FaxServerClass();</FONT></P>
<P><FONT face=3DArial size=3D2>fxsvr.Connect(""); // null for local fax =
server=20
otherwise a computername</FONT></P>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>I use the FAXCOMLib library under =
Windows=20
2000.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Thanks,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> Mircea</FONT></DIV>
<DIV><BR></DIV></BODY></HTML>
------=_NextPart_000_0008_01C4334F.6BB03700-- Tag: Use MDB file on machine where Office Tag: 74403
Remote Administration
I developed and run some ASP.NET applications on my local machine. I have
IIS 5.0 available on two servers from two different ISPs. I would like to
have the applications served from the two ISP controlled machines. I have
FTP-access (only) to the two remote servers.
Simple .aspx applications execute (such as trace) but .aspx applications
with a .aspx.cs code behind file fail on the statement ...
<%@ Page language="c#" Codebehind="Sample.aspx.cs" AutoEventWireup="false"
Inherits="Sample.Sample" %>
... because it can not resolve the Sample.Sample
Any suggestions on how to proceed?
Is there documentation available on installing an application on a remote
ISP-controlled machine?
--
-- Thom Little -- www.tlaNET.net -- Thom Little Associates, Ltd.
-- Tag: Use MDB file on machine where Office Tag: 74399
Fail to use ManagementOption to connect network drive
hihi
I had tried to follow MSDN sample code of System.Management.ManagementOption to connect network drive. But when i use scope.Connect(), it occurs Exception. I just use it to connect other computer shared drive. I had type user name and password. The path just is "\\\\computerName\\shareName" or "\\\\IPAddress\\shareName" that both are fail. Anyone tried it
thx... Tag: Use MDB file on machine where Office Tag: 74398
Usage of AppDomain.CreateInstanceFromAndUnwrap method
i am trying to load a Windows Form Assembly at run time to a seprate AppDomain.
I don't want that this Assembly to be loaded in the Caller Domain, so i used the metho
CreateInstanceFromAndUnwrap instead of AppDomain.Load(..
// I am passing the Control's parent through the constructor argumen
Object[] args1 = new Object[] {this}
AppDomainSetup info = new AppDomainSetup()
info.ApplicationBase = "file:///" + System.Environment.CurrentDirectory
AppDomain MyDomain = AppDomain.CreateDomain("MyDomain", null, info)
MyControl.MyControl Ctrl = (MyControl.MyControl) MyDomain.CreateInstanceFromAndUnwrap("D:\Test\MyControl.dll",MyControl.MyControl
false,BindingFlags.Public,null,args1,null,null,null)
But when i do this i get an exception thrown "Constructor on type MyControl.MyControl not found
What should be cause of this issue?
If i try to use the CreateInstanceFromAndUnwrap using the two parameters just the assembly and type, the functio
returns me the control object. But when i try to set the Parent of the control using the followin
code
Ctrl.Parent = this
then system throws an exception the message is
The type System.Windows.Forms.Form+ControlCollection in Assembly System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 is not marked as serializable
What am i doing any thing wrong in this both scenarios
Or is it advisable to have a design where i can load my Windows Forms Assemblies in to a seprat
Domain and use, and later unload it
Any body please help.... Tag: Use MDB file on machine where Office Tag: 74397
How to map network drive in windows service without using API in C#
hihi
I need to use windows service to connect network drive, so I cannot use "net use" to connect network drive. I hope it can connect the network drive under windows service. Therefore if I don't want to use API WNetAddConnection function, any C# Class can do it directly
thx... Tag: Use MDB file on machine where Office Tag: 74394
How does the DataView.Sort method really work under the covers?
How does the DataView.Sort method really work under the covers?
I know that it sorts a dataview, but what kind of sorting algorhythm is
actually used?
Thanks. Tag: Use MDB file on machine where Office Tag: 74392
Sorting
Hi All,
I have an xml file as listed below. This is a list of scripts. Some of the
scripts depend on the output of other scripts. I want to sort this xml in
such a way that the scripts are listed in the correct order of execution. I
created an IComparer class and implememted the Compare method. I am calling
Array.Sort on an XmlNode array. The sorting is not correct. Can anyone
suggest a correct algorithm for a compare method to sort this XML?
Thanks.
James
<root>
<scripts>
<script>
<name>script0</name>
<sequence>0</sequence>
<references>script6|script14|script20|script4|script24|script16|script9|scri
pt22|script25</references>
</script>
<script>
<name>script1</name>
<sequence>1</sequence>
<references>script0|script6|script14|script9|script25|script15</references>
</script>
<script>
<name>script2</name>
<sequence>2</sequence>
<references>script10|script6</references>
</script>
<script>
<name>script3</name>
<sequence>3</sequence>
<references>script0|script6</references>
</script>
<script>
<name>script4</name>
<sequence>4</sequence>
<references>script6|script20</references>
</script>
<script>
<name>script5</name>
<sequence>5</sequence>
<references>script6</references>
</script>
<script>
<name>script6</name>
<sequence>6</sequence>
<references>
</references>
</script>
<script>
<name>script7</name>
<sequence>7</sequence>
<references>script10|script6|script14</references>
</script>
<script>
<name>script8</name>
<sequence>8</sequence>
<references>script10|script6|script14</references>
</script>
<script>
<name>script9</name>
<sequence>9</sequence>
<references>script7|script8|script10|script11|script2</references>
</script>
<script>
<name>script10</name>
<sequence>10</sequence>
<references>
</references>
</script>
<script>
<name>script11</name>
<sequence>11</sequence>
<references>script14|script6|script2|script10</references>
</script>
<script>
<name>script12</name>
<sequence>12</sequence>
<references>script6|script0</references>
</script>
<script>
<name>script13</name>
<sequence>13</sequence>
<references>script14|script6</references>
</script>
<script>
<name>script14</name>
<sequence>14</sequence>
<references>script6</references>
</script>
<script>
<name>script15</name>
<sequence>15</sequence>
<references>
</references>
</script>
<script>
<name>script16</name>
<sequence>16</sequence>
<references>script6|script20</references>
</script>
<script>
<name>script17</name>
<sequence>17</sequence>
<references>script6|script18</references>
</script>
<script>
<name>script18</name>
<sequence>18</sequence>
<references>script6|script25</references>
</script>
<script>
<name>script19</name>
<sequence>19</sequence>
<references>script6</references>
</script>
<script>
<name>script20</name>
<sequence>20</sequence>
<references>script6|script15</references>
</script>
<script>
<name>script21</name>
<sequence>21</sequence>
<references>script6|script24|script0|script20</references>
</script>
<script>
<name>script22</name>
<sequence>22</sequence>
<references>script6|script15|script24|script20</references>
</script>
<script>
<name>script23</name>
<sequence>23</sequence>
<references>
</references>
</script>
<script>
<name>script24</name>
<sequence>24</sequence>
<references>script6|script25</references>
</script>
<script>
<name>script25</name>
<sequence>25</sequence>
<references>script6</references>
</script>
<script>
<name>script25</name>
<sequence>26</sequence>
<references>script0|script2|script4|script7|script8|script9|script10|script1
1|script14|script19|script18|script20|script24|script25|script16|script5|scr
ipt22|script15|script6|script1</references>
</script>
</scripts>
</root> Tag: Use MDB file on machine where Office Tag: 74387
File.Move and NTFS File Permissions on the Source
I realize that File.Move is a thin wrapper around the Win32 MoveFile
API, so what I'm about to describe I think applies to that API. If NTFS
permissions grant you read access to the source file but deny you the
rights to delete the source file, I believe I've discovered -- much to
my surprise -- that File.Move will copy the file to the target but fail
to delete the source. And do this without returning an error (or
equivalently, in managed code, without throwing an exception).
I've included a tiny console app that I used to test. Does anyone know
if this is expected behavior? I've come across no documentation or
comments to suggest that this is correct.
In my application, this behavior will be problematic -- i.e. if the
source cannot be deleted, I need the call to not do anything. I suspect
I'll have to do the copy and delete as separate calls...
using System;
using System.IO;
namespace MoveTester
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
if (args.Length != 2)
throw new ArgumentException("Usage:
MoveTester <sourcefile> <destfile>");
string File1 = args[0];
string File2 = args[1];
Console.WriteLine("Moving file {0} to {1}", File1,
File2);
try {
File.Move(File1, File2);
Console.WriteLine("Done!");
}
catch (Exception E) {
Console.WriteLine(E.ToString());
}
}
}
} Tag: Use MDB file on machine where Office Tag: 74385
C# LDAP libraries and ASP.NET
Hi All
I am trying to authenticate users against a Novell LDAP v3 using ASP.NET
and C# LDAP classes. I have compiled the files to one assembly and
reference it in my code. My problem is the following: I can connect
successfully to the LDAP server, but as soon as I try to Search or Bind,
the following error occurs - "Server did not return any data". Here is the
code sample:
using Novell.Directory.Ldap;
LdapConnection ldapConn = new LdapConnection;
ldapConn.Connect("192.000.0.00",389); // use proper LDAP Server IP Address
if(ldapConn.Connected)
{
ldapConn.Bind("cn=yourname,ou=IT,ou=WEB,o=ORG","password");
}
PLEASE HELP!!! I really need some HELP here. The LDAP directory has the
following schema or structure: ORG -> WEB -> IT -> user data
I did not find any documentation with the C# LDAP classes and URGENTLY
need some help in searching and binding.
All help is HIGHLY APPRECIATED.
Thank you
Walter Tag: Use MDB file on machine where Office Tag: 74384
.NET Framework AutoUpdater
Some of you might be interested in this open source AutoUpdater for
.NET
"Sharp AutoUpdater provides an auto-update feature for .NET
applications. Using XML configuration files, Sharp AutoUpdater
component detects if there is a new version of the software,
downloads, unzips, and installs the new files."
Link: http://csautoupdater.sourceforge.net/ Tag: Use MDB file on machine where Office Tag: 74382
clipboardformat, Xml Spreadsheet
Can anyone help me with copying spreadsheet format to the clipboard.
I have this text
<Workbook>
<Worksheet>
<Table>
<Row>
<Cell ss:Type="String">MyData</Cell>
<Cell ss:Type="String">MyData</Cell>
</Row>
</Table>
</Worksheet>
</Workbook>
I put that into a memorystream (UTF8),
then call
DataObject ob = new DataObject();
ob.SetData("XML Spreadsheet", ob);
Clipboard.SetDataObject(ob, true)
When I try to paste this into excel it complains that it can't paste the
data.
what am I doing wrong? Tag: Use MDB file on machine where Office Tag: 74380
Application Blocks: ExceptionXmlPublisher log viewer?
I'm using the ExceptionXmlPublisher provided by Kirk Evans.
Is there a log viewer or xsl stylesheet to read the xml put out by the
publisher? It's not well-formed xml (no root element) and it's deep.
Any help would be great.
Thanks.
--Mark
majohnson@gr.com Tag: Use MDB file on machine where Office Tag: 74376
Rolling my own Install w/ MSDE
I rolled my own install that checks to see if SQL server is there like so
Dim svc As ServiceProcess.ServiceControlle
Tr
svc = New ServiceProcess.ServiceController("MSSQLServer"
Catch ex As Exceptio
Return ValRetCodes.NotInstalle
Exit Functio
End Tr
Dim startDate As DateTim
If Not IsNothing(svc) The
..
Els
Return ValRetCodes.NotInstalle
End I
Problem... on one user's box it runs, starts MSDE's install, but stops because it found datafiles
C:\Program Files\Microsoft SQL Server\MSSQL\Data\master.md
C:\Program Files\Microsoft SQL Server\MSSQL\Data\mastlog.ld
So my check was fruitless. Is MSDE installed? Is SQL installed? What's a better way to check, and if it's installed, how can I use it for my database, or should I? Tag: Use MDB file on machine where Office Tag: 74375
Software and Hardware Inventory
Hi,
There are some good extensive samples or components that make software and hardware inventory with WMI easy
I'm seeking some examples or WMI class/property listing to catch the components in the machine that mades up a good software/hardware inventory.
Regards
Lucas Ponzo Tag: Use MDB file on machine where Office Tag: 74374
IDisposable.Dispose, Object.Finalize and threads
IDisposable.Dispose is documented as the method where you have to release
unmanaged resources.
Dispose is called by Finalize.
Finalize is called by garbage collector after the object becomes
inaccessible.
The documentation says: "The thread on which the finalizer is run is
unspecified".
So the question is: My object has allocated a [win32] window handle using
CreateWindow (called using P/Invoke) and has to destroy it. But Win32 SDK
say that DestroyWindow has to be called from the same thread that called
CreateWindow. This seems impossible given Dispose/Finalize/GC patern.
Any advice ?
btw: Let me know if I should post to another group.
--
francois.piette@overbyte.be
The author for the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be Tag: Use MDB file on machine where Office Tag: 74373
question about paging in Datagrid
question about paging in Datagrid.
i would like to ask, normally, we bind the datagrid with DataSet
if a query like "select * from item" contains 1000000 records, it seems that
getting all the records and load it in the memory(DataSet) is a
resource-consuming task. (please correct me if i say something wrong)
So, i was planning to connect to database and fetch 10 items each time, when
page is changed, connect to database again and fetch next 10 items.
Is my planning a good way to save the resources? or Paging in datagrid has
done something to save the resource? Tag: Use MDB file on machine where Office Tag: 74372
Using Help remotely
Hi,
I have a client program that is one touch installed and hosted on an IIS server.
My question is, what is the best way to provide user interface help to the client program.
Two ideas have come to mind.
1) - Let the client program download the .chm and reference it locally. This is probably a pain.
2) - Let the client do remote calls to the server to request the help and the server then returns the requested help info. Not
really sure exactly how I would make that work.
Since I am not sure that either of these ideas is really workable, there must be a third and correct way. Would someone please
enlighten me as to what it is?
Thanks
-------------------------------------------
Roy Chastain
KMSystems, Inc. Tag: Use MDB file on machine where Office Tag: 74370
How to cancel a pending BeginReceive ?
What is the proper way to cancel a pending BeginReceive/EndReceive ?
Can it be done without generating an exception ?
Currently I shutdown and close the socket. The blocking "EndReceive"
throws System.ObjectDisposedException.
I try to avoid throwing exceptions when ever possible, and reserve
them for unanticipated problems. Trying to stop a background
read/process loop is an anticipated activity. For me the debugger
delays 15 seconds when ever an exception is thrown. But regardless, I
am hoping for a cleaner approach. I can not find guidance on this
issue in framework documentation.
Forgive the cross posts. It would be nice to have a specific
framework/network related NG.
Thanks for any insight - Best regards - Lee Gillie - Spokane, WA Tag: Use MDB file on machine where Office Tag: 74367
how to embed xml data in resx file
Hi,
I am trying to embed xml data within resx file without success. Here's
my data tag -
<data name="foo" type="System.String, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value><![CDATA[ <myroot><otherdata>blah..<otherdata></myroot>
]]>
</value>
Even though I have used CDATA section, I get "blah..." when I try to
access "foo" as opposed to my xml data "<myroot>.....</myroot>".
Thank you.
Regards,
Amitava Shee Tag: Use MDB file on machine where Office Tag: 74364
Signing Assemblies
Using VS .Net 2003
1. I'm confused on how to remove compile errors below.
Not sure if I need/how to use Al.exe and Gacutil.exe tools
with VS, etc.
2. My company doesn't have a private key and the local
windows application I'm creating is for internal company
network use only. Should I create a public key?
3. My goal is to compile a Release version of the
application to the network and then use caspol tool to
trust assembly. Make Sense?
Steps:
(a) Created key pair (sn -k foo.snk) and copied foo.snk
to C# project \obj directory (is my next step: sn -p
foo.snk fooPub.snk & AssemblyDelaySign(true) &
AssemblyKeyFile (fooPub.snk) ???)
(b) Changed AssemblyInfo.cs contents:
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile(@"C:\...\obj\foo.snk")]
[assembly: AssemblyKeyName("")]
(c) Resulting compile errors (2):
Assbly gen. failed -- Ref assbly 'Interop.Word'
& 'Interop.Excel' no strong name
Thanks - Steve Tag: Use MDB file on machine where Office Tag: 74363
HELP-Sorted Datagrids and modal dialogs
I have been on newsgroup for week. I have seen anything that will help me. Basically, I have a form with a datagrid that can be sorted or unsorted (it is up to the user). Then, I display the data of the selected row in textboxes on dialog that execute by the user press a button. The following code works if I do not sort the datagrid before I press the button to bring up the dialog. It is when I sort it the datagrid I have the issue
private void Frm_CustomerAU_Load(object sender, System.EventArgs e
Frm_Customers frmCustomers= (Frm_Customers) this.Owner;
CurrencyManager currencyMgr = (CurrencyManager)this.BindingContext[frmCustomers.tableInfoDG.DataSource, "Table"]
currencyMgr.Position = frmCustomers.tableInfoDG.CurrentRowIndex
DataRow currentRow = ((DataRowView)currencyMgr.Current).Row
txtBxCompanyName.Text= currentRow["CompanyName"].ToString()
I have also tried using the following code to bind the table to the textbox and I get the same result
txtBxCompanyName.DataBindings.Add("Text", frmCustomers.tableInfoDG.DataSource, "Table.CompanyName")
I believe it has something to do what I am setting CurrencyManager position to ( currencyMgr.Position = frmCustomers.tableInfoDG.CurrentRowIndex;). I know I need it to be the position of the underlying table in order to get the selected position in the datagrid. I just do not know how to get the position. By the way, this is C
Any help would be greatly appreciated Tag: Use MDB file on machine where Office Tag: 74362