.NET Compact Framework - Better with C#, not VB?
According to this article, if using VB FileSystem I/O isn't supported.
http://msdn2.microsoft.com/en-us/library/t340010s.aspx
Does this mean that if using C# it is supported? Or does it only mention VB
but it applies to all languages?
Also, all the links on this page only refers to VB, not C#. Is there a
difference between the 2 when programming in the .NET compact environment?
Thanks Tag: LINQ and Informix Tag: 138038
Best Book for WorkFlow
In the past I worked for an Insurance Distribution company who developed
workflow software. I understand workflow quite well but have not been able
to get an understanding of it in .NET. Whet is the best book for a beginner
and the best book for reference for .NET Workflow. Iâ??m developing the
application using C# .NET 3.5 with LINW to SQL.
Thank You!
Alexander L. Wykel Tag: LINQ and Informix Tag: 138037
Locate ending bracket in VS for obfuscated code !
Hi,
I am using Visual Studio 2005 to debug a program. It is like
obfuscated code, so I wonder if given a starting bracket, VS can tell
me where the closing bracket is.
By the way, I also wonder if this is the right group to ask these
questions. Otherwise suggestions are welcome !
Thanks in advance Tag: LINQ and Informix Tag: 138029
distribuzione di un'applicazione
Ho finito di sviluppare un'applicazione Windows (C# 2005), composta di un
.exe di avvio e vari .dll, e la devo distribuire. Domanda: come faccio a
impedire che le dll che distribuisco insieme allâ??applicazione siano open
source, cioè utilizzabili per un altro progetto (non mio) semplicemente
aggiungendole come riferimento a questo progetto? Tag: LINQ and Informix Tag: 138028
LINQ question
This is a multi-part message in MIME format.
------=_NextPart_000_00EE_01C884E8.00DD6E90
Content-Type: text/plain;
format=flowed;
charset="iso-8859-1";
reply-type=original
Content-Transfer-Encoding: 7bit
I have a desktop aplication which use an embeded database engine (embeded in
the application that is) to store its data.
And I used LINQ 2 SQL as an ORMapper to synchronize the database with my
object representation in memory.
What I want to do is load most object at the start, do in memory work, and
occasionaly load additional big data or save the changes.
I have a problem with the DataContext.GetTable<T>() mehod. It seems
everytime I do a foreach on its retur it will query the database, is that
true?
So in my particular case I'm better off working with an List<T> which I will
initialize from the GetTable<T> result?
Just in case I wrote such a list (Code attached) and I wonder if I did it
the proper way, if anyone can take a look?
Also I have a table like that
Data
--------
ID int
summary nvarchar(256)
content image
which I loaded in
[Table("Data")]
class Data
{
[Column(...)]
public int ID {get; set; }
[Column(...)]
public sring Sumary { get; set; }
[Column(...)]
public byte[] Content { get; set; }
}
Now Content is potentially big and I want to use lazy loading, i.e. I DON'T
want to load the 'byte[] Content' with the rest of the data (I guess it's
easy, just remove the ColumnAttribute), but I DO want to save the Content,
if it's not null (i.e. if it has been explicitely loaded/set/modified) when
SubmitChanges() is called on the Context.
Any tip on how to do that?
Moreover, if I only change the content (which will have no ColumnAttribute)
how do I mark my entity as dirty in the context? (i.e. I would need an
'UpdateOnSubmit()' method in the table, but it doesn't exists..)
------=_NextPart_000_00EE_01C884E8.00DD6E90
Content-Type: text/plain;
format=flowed;
name="LinqList.cs";
reply-type=original
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="LinqList.cs"
=EF=BB=BFusing System;
using System.Collections.Generic;
using System.Data.Linq;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
namespace Galador.Utils.SQL
{
/// <summary>
/// This will hol an in memory representation of some LINQ data.
/// All data will be loaded at creation time and furter work would
/// be done in memory.
/// </summary>
/// <typeparam name=3D"T"></typeparam>
public class LinqList<T> : IList<T>
where T : class
{
List<T> data;
public LinqList(DataContext ctxt)
{
if (ctxt =3D=3D null)
throw new ArgumentNullException("ctxt");
data =3D new List<T>(ctxt.GetTable<T>());
}
public LinqList(DataContext ctxt, Expression<Func<T, bool>> predicate)
{
if (ctxt =3D=3D null)
throw new ArgumentNullException("ctxt");
data =3D new List<T>(ctxt.GetTable<T>().Where<T>(predicate));
}
public LinqList(DataContext ctxt, Expression<Func<T, int, bool>> =
predicate)
{
if (ctxt =3D=3D null)
throw new ArgumentNullException("ctxt");
data =3D new List<T>(ctxt.GetTable<T>().Where<T>(predicate));
}
public LinqList(DataContext ctxt, Func<T, bool> predicate)
{
if (ctxt =3D=3D null)
throw new ArgumentNullException("ctxt");
data =3D new List<T>(ctxt.GetTable<T>().Where<T>(predicate));
}
public LinqList(DataContext ctxt, Func<T, int, bool> predicate)
{
if (ctxt =3D=3D null)
throw new ArgumentNullException("ctxt");
data =3D new List<T>(ctxt.GetTable<T>().Where<T>(predicate));
}
public DataContext Context { get; private set; }
#region IList<T> Members
public int IndexOf(T item)
{
return data.IndexOf(item);
}
public void Insert(int index, T item)
{
if (item !=3D null)
Context.GetTable<T>().InsertOnSubmit(item);
data.Insert(index, item);
}
public void RemoveAt(int index)
{
T item =3D data[index];
if (item !=3D null)
Context.GetTable<T>().DeleteOnSubmit(item);
data.RemoveAt(index); ;
}
public T this[int index]
{
get { return data[index]; }
set
{
RemoveAt(index);
Insert(index, value);
}
}
#endregion
#region ICollection<T> Members
public void Add(T item)
{
Insert(Count, item);
}
public void Clear()
{
Context.GetTable<T>().DeleteAllOnSubmit<T>(data);
data.Clear();
}
public bool Contains(T item)
{
return data.Contains(item);
}
public void CopyTo(T[] array, int arrayIndex)
{
data.CopyTo(array, arrayIndex);
}
public int Count
{
get { return data.Count; }
}
public bool IsReadOnly
{
get { return false; }
}
public bool Remove(T item)
{
int index =3D IndexOf(item);
if (index < 0)
return false;
RemoveAt(index);
return true;
}
#endregion
#region IEnumerable<T> Members
public IEnumerator<T> GetEnumerator() { return data.GetEnumerator(); }
#endregion
#region IEnumerable Members
System.Collections.IEnumerator =
System.Collections.IEnumerable.GetEnumerator() { return GetEnumerator(); =
}
#endregion
}
}
------=_NextPart_000_00EE_01C884E8.00DD6E90-- Tag: LINQ and Informix Tag: 138024
How to capture "printfs" from unmanaged C++
I posted this to the interop group. I'm reposting to troll for a few
more ideas.
In my managed C# app we capture trace statements and direct them to a
log file using trace listeners. Part of the app uses unmanaged C++
dlls, and unfortunately, the C++ printfs don't get picked up and are
simply printed to the console window.
Is there any way I can capture the output of the printfs and then
redirect them to the same file that the trace listener is writing to?
I do have access to the unmanaged C++ code if the solution involves
not using printfs. The important thing is that the C++ printfs and the
C# trace messages end up in the same file.
One solution from the interop group was to compile the C++ with /clr
and then replace the printfs with Trace.WriteLine(). Any less invasive
techniques. Maybe somehow redirecting the printfs to someplace that
can be picked up by .Net.
Thanks
Mitch Tag: LINQ and Informix Tag: 138023
Microsoft Office compatible with Mac and Pc
Hi there I am looking to buy MO 2007 Home and Student version. I have both a
PC and a Mac and would like to install a suite on both. Is this possible or
will I have to buy seperate packages?
Best wishes,
Pam Tag: LINQ and Informix Tag: 138012
.NET Windows Forms Security
How do I install a custom windows forms permission set and code group
without the SDK configuration tool? Tag: LINQ and Informix Tag: 138009
() in attribute declaration
I have seen attributes, specifically Serializable declared in 2 ways and was
wondering if anyone had any insight on the differance if there is any. These
2 ways are [Serializable] and [Serializable()]. Does the addition of the
parenthesis do anything? Is this calling a constructor? Both seem to have the
same effect in the end, but it seems like they should do something differnt? Tag: LINQ and Informix Tag: 138007
System.Timers.Timer and Close/Dispose
The short form of this post is as follows. For an instance of
System.Timers.Timer, after setting Enabled to False, is there a foolproof way
to tell if an Elapsed event will or will not fire?
The long form follows. I have a class, MyClass, that declares
Private WithEvents MyTimer As System.Timers.Timer
Sub New for MyClass initializes MyTimer to fire Elapsed events every second.
I have an Elapsed event handler and some public methods. With SyncLock,
I've made MyClass instances thread safe. Everything works fine.
System.Timers.Timer has Close and Dispose methods, so I when I want to
destroy an instance of MyClass, I should Close or Dispose MyTimer. I've
coded MyClass.Close to look like this:
MyTimer.Enabled = False
' some cleanup I need to do
Sleep(100) ' let fire an enroute MyTimer.Elapsed
MyTimer.Dispose() ' per IDisposable
' some more cleanup I need to do
The reason for the Sleep is because of how Windows/.NET executes
MyTimer.Elapsed events. The Timer.Stop documentation says:
"The Elapsed event is raised on a ThreadPool thread, so the event-handling
method might run on one thread at the same time that a call to the Stop
method runs on another thread. This might result in the Elapsed event being
raised after the Stop method is called."
Stop and Enabled=False do the same thing. The Timer.Stop documentation goes
on to give a somewhat elaborate mechanism to overcome contention and race
conditions that might arise. My solution is Sleep(100).
I don't like my use of Sleep. I don't like the elaborate mechanism in the
documentation because it looks like it could fail if someone is messing with
thread priorities (note that the mechanism uses Sleep(0)).
So, the question is: For an instance of System.Timers.Timer, after setting
Enabled to False, is there a foolproof way to tell if an Elapsed event will
or will not fire? Tag: LINQ and Informix Tag: 138004
Good C# profilers?
Hi...
I was just wondering what recommendations people had for C# code profilers?
I'm trying to figure out where a lot of our app's time is going.
I downloaded and am trying ProfileSharp Enterprise Edition, but I'm finding
the interface awkward and the results suspect (profiling for cpu cycles, it
says Thread.Sleep is the most expensive function).
Has anyone had particularly good experience with a C# code profiler?
Thanks
Mark Tag: LINQ and Informix Tag: 138003
EnterpriseLibrary.Logging
Hi all,
I have installed EnterpriseLibrary v3.1 (latest version) on my pc. When I
create the app.config file using the "EnterpriseLibrary Configuration"
utility, I get an error saying it can't detect the EL.Logging.dll file. I
fixed the problem by setting the PublicKeyToken= "null" instead of its
default PublicKeyToken="b03f5f7f11d50a3a".
eg.
configSections>
<section name="loggingConfiguration"
type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings,
Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0,
Culture=neutral, PublicKeyToken=null" />
<section name="exceptionHandling"
type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.ExceptionHandlingSettings,
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=3.1.0.0,
Culture=neutral, PublicKeyToken=null" />
</configSections>
The thing is that I can't understnad why this error is occuring in the first
place. This pc is newly set-up and it has never had any prior versions of EL
installed on it. The "EnterpriseLibrary Configuration" utility comes with
this v3.1 setup.
Thanks for your reply.
regards,
Andrew Tag: LINQ and Informix Tag: 137998
GDI and Rotating Text
Hi,
I want to use GDI to rotate some text at an angle and output the
resultant image to the asp.net response stream.
I can do that all fine, however what I'm struggling with is trimming
the whitespace from the resultant image.
What im doing is creating a blank canvas image (of arbitrarily large
size) and doing a translate transform to the centre, then applying a
rotate transform, then writing my text.
What i want to do is trim all the whitespace from around the edges. Is
there some way i can determine the width and height of the text ive
written to the image (after the transform) ?
I know i can manually get the text dimensions before the rotate, then
use some trig to work out how high and wide it would be after rotating
it but thats a bit of a pain if theres some function that will do it
for me
Thanks for any advice
Andrew Tag: LINQ and Informix Tag: 137996
Fold and unfold easily code
Hi,
I am looking for some addin-plugin-external tool for Visual Studio
2005 that would allow me to fold/unfold parts of the code in an easy
way. I don't like the default VS fold mode, its behavior is usually
unpredictable for me.
Thanks Tag: LINQ and Informix Tag: 137995
System.Net.Mail issue
Hi,
I'm using System.Net.Mail to send email in C#.
When I have word "do not" in the mail's body, I couldn't get the mail.
THis is wired, any idea?
Thanks.
William Tag: LINQ and Informix Tag: 137987
framerwork distriburion - licence
I'd like to distribute the .NET framework with my application. I'm
wondering about the license. My application is being created with
Borland Delphi 8 (with .NET) - I've the license for that product. So
the question is: may I distribute the .NET framework with my app?
I was trying to find this information on the Microsoft's web page -
but I've found it impossible.
Please help me,
cezar Tag: LINQ and Informix Tag: 137984
Windows service startUp error
Hi all,
My question consists of 2 parts:
1) I have installed my windows service [by right-click on Setup.exe in
SolutionExplorer, then Install ... ] onto a folder on my desktop. When I
click on the MyNewService.exe file, I got the following error message:
" Cannot start service from the command line or a debugger. A Windows
Service must first be installed (using installutil.exe) and then started with
the ServerExplorer, Windows Services Administrative tool or the NET START
command. "
2) Is the problem because I need to install using "installutil /i
C:\MyNewService3.exe" ?
I tried that and i got the error message:
" Exception occurred while initializing the installation:
System.IO.FileNotFoundException:
File or assembly name Documents, or one of its dependencies, was not found. "
Any advice on understanding what this message says ?
Thanks.
regards,
Andrew Tag: LINQ and Informix Tag: 137978
Caching of DateTime.Now?
Hi...
We have some elapsed time stopwatches using the QueryPerformanceCounter()
win32 api, but since I was getting tired of doing the arithmatic all the time
I added some DateTime.Now.ToString("HH:mm:ss.fff")'s to the log and I noticed
an interesting quirk.
There's often about a 5ms difference between the calculations of
QueryPerformanceCounter() values and DateTime.Now and DateTime.Now is always
the one behind.
Is DateTime.Now cached for some period of time to avoid the expense of
recalculation?
Thanks
Mark Tag: LINQ and Informix Tag: 137977
File Copy exception
Hi all,
I have created a windows service (my first service). I am normally an
ASP.NET developer...
The service is simple. All it does is to watch a directory and copy any
files that land in it to another folder (in this case, the parent folder).
This works fine most of the time, but my first sample file crashed it. It
seems to be down to a file type problem.
My sample file was a .bat file.
I have now put a try/catch around the file copy and come up with
_COMPlusExceptionCode -532459699
At the moment, it only seems to crash with .bat files. I have done a
successful copy of app.config, *.txt. Any ideas?
My code...
public MyService()
{
InitializeComponent();
}
protected override void OnStart(string[] args)
{
// TODO: Add code here to start your service.
FSWatcher.Path = ConfigurationManager.AppSettings["WatchPath"];
}
protected override void OnStop()
{
// TODO: Add code here to perform any tear-down necessary to
stop your service.
}
private void FSWatcher_Created(object sender,
System.IO.FileSystemEventArgs e)
{
try
{
System.IO.File.Copy(e.FullPath, "C:\\temp\\" + e.Name);
}
catch (Exception ex)
{
}
}
--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available Tag: LINQ and Informix Tag: 137975
Create Visual Studio Tools for Office Projects
Hi. I've downloaded & installed the Visual Studo Tools for Microsoft Office.
I have both Visual Studio 2005 Pro & Microsoft Office 2007 Pro installed.
I'm trying to create my first Office project, but I don't see 'Office' as an
available Project Type.
I'm following the directions shown here:
http://msdn2.microsoft.com/en-us/library/0es5szt7(VS.80).aspx
Has anyone seen this before? Any ideas why 'Office' isn't an available
project type.
Thanks. Tag: LINQ and Informix Tag: 137974
Metafile & Graphics
I have a Metafile and a Graphics attached to it and I do several drawings on
the Metafile through the Graphics. After the drawings I need to print the
metafile.
If I try to print the Metafile right away, nothing shows on the page, now,
If I do a Graphics.Dispose() and then print the Metafile, it works without
any problem.
My problem is that after printing the Metafile I still need to work on it
through the Graphics, but if I try to reinitializate the Graphics object with
a call of Graphics.FromImage(metafile), I get a "out of memory" error.
Is there a different way to create a Graphics from a Metafile ?
Is it possible to have access to a Metafile which is attached to a Graphics,
without having to dispose the Graphics ?
Thanks for any help.
______
Marco Tag: LINQ and Informix Tag: 137973
Compiling WF assemblies with /platform:x64
Hello,
I have a service application that uses Windows Workflow Foundation as part
of its processes. One of the class libraries in this application is a
collection of custom WF activities that I have written to represent the bits
of business process.
The solution compiles fine when compiling with the /platform:anycpu flag and
all is good, but when I try to compile the same solution with the
/platform:x64 the class library with the WF activities fail with a "error
348: Compilation failed." It goes on to say "Unable to load one or more of
the requested types." but that's all the help I get.
I'm trying to build the application in a 32 bits machine running Windows XP
SP2, but I will run it in a Windows Server 2003 64 bits.
On the destination machine I have installed the 64 bit version of the
Framework 3.5 and when looking in "C:\WINDOWS\Microsoft.NET\Framework64\v3.0"
I can see only two sub-folders: "Windows Communication Foundation" and "WPF",
whereas in the 32 bit version of the Framework 3.0 I can see a third folder
called "Windows Workflow Foundation". Does it have any relevance?
Any help is appreciated. Tag: LINQ and Informix Tag: 137972
The installer was interrupted before [AppName] could be installed.
I have created a simple Web Application that just contains default.aspx and a
web.config. I have added a Web Setup project to this solution, it Built Fine
in VS2008. The installer works fine on windows Vista x64, but fails on the
Virtual Machines of XP and 2003 R2. The installer reads "The installer was
interrupted before [Setup name] could be installed. You need to restart the
installer to try again."
Both of the installer logs contain this:
MSI (c) (AC:48) ... Note: 1: 2262 2: Error 3: -2147287038
DEBUG: Error 2769: Custom Action WEBCA_EvaluateURLsNoFail did not close 2
MSIHANDLEs.
The installer has encountered an unexpected error installing this package.
This may indicate a problem with this package. The error code is 2769. The
arguments are: WEBCA_EvaluateURLsNoFail, 2,
Action ended 18:24:08: WEBCA_EvaluateURLsNoFail. Return value 1.
I have looked this up and the only offered solution is to run it as
administrator. I have tried running it under an Account in Administrators
and as the local Administrator and still got the same message.
Does anyone know what is going on here? Even if I create a sample project
within one of these VM, it still gives me the same error.
Log:
(too big for here)
http://robinsoft.no-ip.biz/dev/dotnet/errors/WebSetupProjectErrors.txt
Thanks Tag: LINQ and Informix Tag: 137970
www.dotnetvideos.net just released 10 New Videos on Data Tutorials
Hi all, www.dotnetvideos.net released 10 new videos in the following
categories. every registered user of this site still gets a FREE
subscription to asp.netPRO magazine. There are over 120+ Free video
tutorials, all are under 10 mintues. chek them out!!
An Overview of Editing and Deleting Data in the DataList (7 Videos) at
http://www.dotnetvideos.net/OverviewofEditingDeletinginDList/tabid/127/Default.aspx
Performing Batch Updates (3 Videos) at
http://www.dotnetvideos.net/PerformingBatchUpdates/tabid/128/Default.aspx
---venkat Tag: LINQ and Informix Tag: 137968
Need help diagnosing WCF timeout exception
Hello,
I have a Windows Service-hosted WCF service that occasionally throws an
timeout exception, or something that looks like one. The call chain looks
like this:
Client->WCF Service->COM Server->COM App
The exception seems to appear as the call to the service is completing.
Interestingly, these exceptions do not seem to affect the tasks the service
is performing at the time of the error. If the errors are ignored all
subsequent dependent actions are successful.
The exception message is:
The maximum retry count has been exceeded with no response from
the remote endpoint. The reliable session was faulted. This is
often an indication that the remote endpoint is no longer available.
The inner exception says:
The HTTP request to
'http://xpsp2client:8000/CubularityServies/CuIWfcService' has
exceeded the allotted timeout of 00:01:00. The time allotted to this
operation may have
been a portion of a longer timeout.
I also occasionally see an exception claiming that I've exceeded the
inactivityTimeout of 00:10:00.
OK. When I started seeing these I set all the timeout values I could find
to 00:20:00 and the behavior was not affected. I'm setting the following
timeouts in the .config file:
For <binding> :
receiveTimeout
sendTimeout
openTimeout
closeTimeout
For <reliableSession> :
inactivityTimeout
For <host> :
openTimeout
closeTimeout
I'm wondering if there are timeout settings that I'm missing. I don't have
any values less than 20min yet I get errors telling me I've exceeded
timeouts of 1 and 10 minutes. I've used Intellisense to poke around and try
to find properties that aren't obvious in the WCF Config Editor, but haven't
turned up anything.
Any suggestions?
Keith
P.S. I've turned on verbose logging for the service and am trying to
understand them. Some exceptions are shown in the logs but not enough
detail is given to pinpoint the source of these faliure. Tag: LINQ and Informix Tag: 137965
appSettings and applicationSettings
hi,
What is the difference between appSettings and applicationSettings (in the
app.config) for a windows application project with multiple links to .dll
files.
Thanks
regards,
Andrew Tag: LINQ and Informix Tag: 137962
CAS, WPF & plugin question
In my application I am able to load plugins, i.e. use reflection look in an
assembly for classes implementing a given interface and instantiate them.
I would like these plugins to run with restricted right.
Like they are not able to access the file system, etc....
How could I do that?
Also, from some prelimiary reading it seems I will have to run thess plugin
in different AppDomain, but these plugin need to create some WPF.Controls
I'm adding to my main form's visual tree hierachy.
Is it possible to do that? I mean add in the UITree a WPF.Control which is
from a different AppDomain?
(I foresee a dispatcher problem)
Any tip? (or maybe I don't need to run my plugin in a different AppDomain
after all?) Tag: LINQ and Informix Tag: 137956
how to send a reference/addressof some procedure to a new thread?
So, I have a new thread creating something like:
dim myThread as new System.Threading.Thread(AddressOf myProcedure)
but, could I send an any kind of parameter instead of call to myProcedure???
I don't know did I made myself clear, but I would like to have something
like:
public sub StartThread(byref myProc as Object)
dim myThread as new System.Threading.Thread(AddressOf myProc)
mythread.Start
end sub Tag: LINQ and Informix Tag: 137951
smtp DeliveryMethod
Any help with -
'=========== THIS PART IS NOT WORKING ========
section in the code.
I'm not able to send using emails using "C:\temp\" folder!
Any idea!
Thanks
-------------------------------------------------------------------------
Sub SendAsync()
Try
Dim strmsgBody As String = "hello world:
Dim item As String
'Listbox1 items
'email@hotmail.com
'email2@hotmail.com
'email3@hotmail.com and so on...
For Each item In ListBox1.Items
Dim mail As New Net.Mail.MailMessage()
Dim smtp2 As New Net.Mail.SmtpClient("hostname", "25")
Dim cred As New Net.NetworkCredential("username",
"password")
smtp2.Credentials = cred
mail.IsBodyHtml = False
Dim userState As Object = mail
AddHandler smtp2.SendCompleted, AddressOf
SmtpClient_OnCompleted
'=========== THIS PART IS NOT WORKING ========
smtp2.DeliveryMethod =
Net.Mail.SmtpDeliveryMethod.SpecifiedPickupDirectory
smtp2.PickupDirectoryLocation = "C:\temp\"
'=========== THIS PART IS NOT WORKING ========
smtp2.SendAsync("from@email.com", item.ToString, "Subject",
strmsgBody, userState)
smtp2 = Nothing
Next
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
Public Sub SmtpClient_OnCompleted(ByVal sender As Object, ByVal e As
System.ComponentModel.AsyncCompletedEventArgs)
Dim mail As Net.Mail.MailMessage = CType(e.UserState,
Net.Mail.MailMessage)
Dim subject As String = mail.Subject
If e.Cancelled Then
MessageBox.Show("Send canceled for mail with subject:", subject,
MessageBoxButtons.OK, MessageBoxIcon.Error)
End If
If Not (e.Error Is Nothing) Then
MessageBox.Show("error")
Else
MessageBox.Show("msg sent")
End If
End Sub Tag: LINQ and Informix Tag: 137950
Typed datasets and table table adapters components not showing in
Typed datasets and table table adapters components not showing in
Toolbox
Hi,
I have a solution with several projects. One project contains datasets
with table adapters.
When I opened a usercontrol in design mode, it used to have all
datasets and tableadapters in toolbox, under a tab name with the name
of the datasets project
However, I had to upgrate to a new hdd, and did a clean Windows
install, with VS2005, etc
Now, when I open te solution and open a usercontrol in designer, I see
only the other user controls, but no datasets or table adapters as I
used to have before. Sometimes I see a tab with the name of the
datasets project, but on it there is a text telling "There are no
usable controls in this group"
What happend?
I mention, on old HDD I had instaled VS2003 and VS2005, on new one I
have only VS2005 and installed VS2008 express, but then I removed it
(as I thought maybe it caused the issue). I even uninstalled and
reinstalled VS 2005, with no luck.
Can anyone help me with this?
Thank you Tag: LINQ and Informix Tag: 137949
Tab and Ctrl+I in a richtextbox
Hello,
I program a user control which display a RichTextBox and a format
ToolStrip.
I want to process some shortcut keys.
The RichTextBox accepts tab.
Ctrl + I is supposed to format the selection in italic.
But Ctrl+I is also de code for Tab.
So when I press Ctrl+I, a tab is inserted (replacing the current
selection) AND the new selection is formatted in italic.
How can I do this ? Do I have to inherit first the standard RichTextBox
and override the OnKeyDown method ?
--
Fred
foleide@free.fr Tag: LINQ and Informix Tag: 137942
Error 080080008
Please advise how do I solve this problem. I have tried to install the
actualizations without positive result. Tag: LINQ and Informix Tag: 137936
Syntax Difference C#/VB.NET when calling a Method
Hi. I'm a VB.NET developer learning C#, and I have a simple syntax question.
In C# whenever you invoke a method you need to include the parentheses ()
after the method name even if there are no parameters. In VB.NET you don't
have to do this. For example -
IDataReader oReader;
while (oReader.Read) //This will throw an exception
while (oReader.Read()) //This is the correct way.
I'm just curious why C# requires this but VB.NET does not.
Thanks!
Mike Tag: LINQ and Informix Tag: 137929
how to properly sink event or use AxHost.ConnectionPointCookie?
I got trouble from trying to sink event to a class itself.. I want the
inherited webbrowser to handle newwindow2 event and raise it to consuming
control
the crux of the problem is the statement ( for lack of understanding
getCtype and
AxHost.ConnectionPointCookie ):
cookie = New AxHost.ConnectionPointCookie(Me.ActiveXInstance, _
wevents, GetType(DWebBrowserEvents2)) <== error
Here are the high level details
the class is
...
public class extendedWebBrowser
inherits system.windows.forms.webbrowser
Private cookie As AxHost.ConnectionPointCookie
Private wevents As WebBrowserExtendedEvents
......
Protected Overrides Sub CreateSink()
MyBase.CreateSink()
wevents = New WebBrowserExtendedEvents(Me)
cookie = New AxHost.ConnectionPointCookie(Me.ActiveXInstance, _
wevents, GetType(DWebBrowserEvents2)) ' <<< oops error about
' not exposing IConnectionPointContainer
End Sub
....
end class
<ComImport(), _
Guid("34A715A0-6587-11D0-924A-0020AFC7AC4D"), _
InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch), _
TypeLibType(TypeLibTypeFlags.FHidden)> _
Public Interface DWebBrowserEvents2
......
End Interface
thank you for your time and expertise Tag: LINQ and Informix Tag: 137928
WCF Service hosted in IIS
Hi All,
based on server2003,
What's the meaning of "BUILD">"Publish WEB SITE" in visual studio 2008 menu
when I create WCF service.
what's the difference between "BUILD WEB SITE" and "Publish WEB SITE"?
When I create the WCF service hosted in IIS, Do I need to publish?
Is it all I need that just make virtual directory on ths iis, and open the
website in the vs2008, coding and saving?
Please, advice me.
Thanks,
soworl Tag: LINQ and Informix Tag: 137924
Updating a collection using a lambda
Hi -
I have a situation where I'd like to use a lambda, but I'm not sure how.
Basically, I have a collection of objects and I want to set a property on
each object that meets a condition.
Right now, I have this:
IEnumerable<VariableCode> codes =
variable.VariableCodeList.Where(c => c.Type == "MyCondition");
foreach (VariableCode code in codes)
{
code.IsShown = true;
}//foreach
I'm thinking that I can replace the foreach bit with a single lambda
expression. Can anyone help me with that syntax?
Thanks.
--
-Paul Prewett Tag: LINQ and Informix Tag: 137920
web deployed assembly
I have a windows forms assembly that needs to be deployed via a webpage.
This bit of code must provide a fully automated printing solution; in that
it must accept a parameter containing a graphic image to print, and print it
without any interaction.
The issue I'm having is that it throws a security exception [Request for
permission of type: System.drawing.printing.printingpermission ... failed].
This bit of code seems to work just fine if I use the print dialogbox and
select the appropriate printer, and of course fails if I don't use the
dialogbox.
This seems to be a security issue, but I'm not sure where to look, or how to
fix it.
And, so as to head off a couple of other issues; I need to pass a parameter
to it from the HTML page, and it has to be served by Linux.
Thanks. Tag: LINQ and Informix Tag: 137919
AccessViolationException with AutoCompleteStringCollection Update
Hi,
i have form with a text box that uses a AutoCompleteStringCollection for
auto completion.
Now if a new value (one not yet contained in the collection) is entered, the
new value should be added to the collection.
Sounds simple, but i often (not always) get a System.NullReferenceException:
with as Stack trace as follows:
bei System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW
bei
System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop
bei System.Windows.Forms.Application.Run
bei FwO.Entry.MainClass.Main
and with that my application crashes.
Does anyone have any idea of what might cause this error and how i can
prevent it?
Thanks for any info./suggestion!
Regards,
Frank Tag: LINQ and Informix Tag: 137918
file io
Hi,
I've a requirement wherein I need to close an opened file programatically.
How can I acheive it/
Thanks
Vijaya Tag: LINQ and Informix Tag: 137914
File IO
Hi,
I've a requirement wherein I need to close an opened file programatically.
How can I acheive it/
Thanks
Vijaya Tag: LINQ and Informix Tag: 137913
is there difference between XP Pro and Server2003?
Hi,
my local machine is XP Pro.
when I built the WCF hosted in IIS, it works fine.
(create virtual directory on IIS and open that website and coding.. that's
it.)
but When I try to built the WCF hosted in IIS in server machine, it causes
error.
(create virtual directory on IIS and open that website and coding. same with
xp pro)
my server machine is Server2003.
After I publish this on the different location in server2003 IIS, it works
fine.
Do I have to publish the WCFservice?
Is there difference between XP Pro and Server2003?
When I publish this, I have to be very careful since they just clean that
folder automatically.
Thanks,
soworl Tag: LINQ and Informix Tag: 137905
Does HttpListener have the same quirk as HttpWebRequest
Hi...
We've implemented a server process using HttpListener to get and process
certain requests, but we've been noticing some odd serialization that
reminded me of a quirk in the client code.
We recently discovered an odd behavior of HttpWebRequest in the client code
where mixing sync and async methods resulted in everything quietly being
sync. Specifically, we were using GetRequestStream() to send the data up
synchronously then calling BeginGetResponse() to wait for the answer async.
Well, it turned out that if you call a sync method first the async calls
magically turn into synchronized ones - a rather undocumented behavior.
Now we're seeing some similar quirks on the server side with HttpListener.
We use BeginGetContext() to listen for a request. Our callback calls
EndGetContext() to get the details and then immediately calls
BeginGetContext() again to wait for another request.
But then we read the request synchronously, post the work in a queue with
the associated response object and move on.
What we're seeing is that if the client sends several requests in a row, it
blasts right through them but the server doesn't acknowledge even reading the
2nd request until after the response to the first request is written to and
closed.
Does HttpListener have some implicit serialization behavior like
HttpWebRequest?
Thanks
Mark Tag: LINQ and Informix Tag: 137904
Any CPU assemblies, Framework64, and Process Explorer
Hi...
We're building our assemblies Any CPU and just now trying to throw them up
on an x64 box. I was using Process Explorer to look at something else, and I
noticed something peculiar. All of our assemblies were in the Framework64
temporary assembly cache for the running process but Process Explorer had
flagged them all as being 32-bit code.
Is this a quirk of Process Explorer not having a mind-meld of the .Net
framework and understanding how the code is being executed, or is Process
Explorer right and it's running in 32-bit mode, despite where it's running
from?
Thanks
Mark Tag: LINQ and Informix Tag: 137903
New Information on Error 1603 when installing .NET Framework all
I was having major issues with installing Visual Studio 2008 on my
computer. In particular the .NET 3.5 component required to run Visual
Studio 2008. I tried everything that was online from editing registry
settings, setting access permissions and all. I was able to install up
to .NET FW 2.0 but past that I kept getting error 1603. This error is
usually an access error telling the user that the target drive, folder
or file is unaccessible. I found when doing a verbose log with the
install the Microsoft IIS installation on my computer was corrupted
and I needed to reinstall IIS on my computer. The best fix for this
issue is
1st: Uninstall the IIS server off of the computer.
2nd: Run the .NET FW 3.5 Installer
3rd: Re-Install IIS from the Windows CD-ROM.
4th: I was then able to install Visual Studio 2008 on my computer
after fixing this.
I hope this helps everyone out and sheds some light on installing. Tag: LINQ and Informix Tag: 137902
Call for speakers for DataServices World (June 24, New York City)
Call for Speakers Closes March 15
DataServices World
New York City (June 24, 2008)
The complexities of distributed processing and the importance of
middleware can elude even senior technical people, including enterprise
architects, IT managers, consultants and designers. Enterprise
developers embraced the separation of presentation, data services and
application logic. Internet computing, web services and service-oriented
architecture (SOA) continued a trend towards moving data access and data
integration logic into a separate data services layer.
The data services layer, databases and data access are the focus of
DataServices World. We're looking for technical presentations about
architecture and solutions for data access and data integration from
heterogeneous data sources including SQL tables, geo-coded data,
content management systems, enterprise resource planning (ERP) systems,
data warehouses, and web data. Topics of interest include:
· End-to-end performance optimization: (database, metadata, data
distribution, caching, query tuning, load balancing, protocols, data
services)
· Information as a service
· Data services development: architecture, tools, LINQ, ADO.NET
Entity Framework, Astoria
· Essential capabilities for effective, robust, secure data
services
If you're interested in speaking, you must submit a proposal by March
15, 2008.
Curriculum sketch and more information:
http://dataservicesworld.sys-con.com/general/papers0608.htm
======== Ken North ===========
www.KNComputing.com
www.WebServicesSummit.com
www.SQLSummit.com
www.GridSummit.com Tag: LINQ and Informix Tag: 137894
403: Forbidden exception
Hi there,
I'm traying to consume a web service over an https:// connection (see
some threads before ;-) ), and I got it:
System.Net.WebException
The request failed with HTTP status 403: Forbidden.
at
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage
message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters)
...
Is this because I need to authenticate with username and password? Or is
because of som certificate-related issue?
In the first case (authentication), should I use the following?
Service proxy = new Service(); //new web service proxy instance;
string username = ConfigurationManager.AppSettings["Username"]; //read
username from the config file
string password = ConfigurationManager.AppSettings["Password"]; //read
password from the config file
System.Net.NetworkCredential credentials = new
System.Net.NetworkCredential(username, password);
proxy.Credentials = credentials;
Thanks in advance,
Giulio - Italia
--
OnAir: Emily Loizeau - "Sur la route"
http://www.giuliopetrucci.it Tag: LINQ and Informix Tag: 137893
Passing a Generic as a Parameter
This seems like something that should be possible, but I am having
trouble setting up a function to accept a generic type as a parameter.
A basic function that shows what I am trying to do:
Public Class BaseRecord(Of T)
Protected _id As Integer
Public ReadOnly Property ID() As Integer
Get
Return _id
End Get
End Property
End Class
Public Class StringRecord
Inherits BaseRecord(Of String)
Private _value As String
Public ReadOnly Property Value() As String
Get
Return _value
End Get
End Property
End Class
Public Class Validation
Public Shared Function ValidateRecord(ByVal record As
BaseRecord(Of Object)) As Boolean
If record.ID < 0 Then
Return False
Else
Return True
End If
End Function
End Class
However, when I try to call the validation function like this:
Dim rec As New StringRecord()
Validation.ValidateRecord(rec)
I get an error stating "Value of type StringRecord cannot be converted
to BaseRecord(Of Object)"
I have tried making the function "Byval record as BaseRecord(Of T)"
but it states that "Type T is not defined"
Is there a way to pass this record as I am attempting or do I need to
completely rethink the way I am wanting to do validation?
Thank you,
Mike Tag: LINQ and Informix Tag: 137877
Passing a Generic as a Parameter
This seems like something that should be possible, but I am having
trouble setting up a function to accept a generic type as a parameter.
A basic function that shows what I am trying to do:
Public Class BaseRecord(Of T)
Protected _id As Integer
Public ReadOnly Property ID() As Integer
Get
Return _id
End Get
End Property
End Class
Public Class StringRecord
Inherits BaseRecord(Of String)
Private _value As String
Public ReadOnly Property Value() As String
Get
Return _value
End Get
End Property
End Class
Public Class Validation
Public Shared Function ValidateRecord(ByVal record As
BaseRecord(Of Object)) As Boolean
If record.ID < 0 Then
Return False
Else
Return True
End If
End Function
End Class
However, when I try to call the validation function like this:
Dim rec As New StringRecord()
Validation.ValidateRecord(rec)
I get an error stating "Value of type StringRecord cannot be converted
to BaseRecord(Of Object)"
I have tried making the function "Byval record as BaseRecord(Of T)"
but it states that "Type T is not defined"
Is there a way to pass this record as I am attempting or do I need to
completely rethink the way I am wanting to do validation?
Thank you,
Mike Tag: LINQ and Informix Tag: 137876
Does anybody know if LINQ currently supports (or vice-versa) Informix?