When I re-enter my blog, I am already authorized. How to avoid this?
.Net Development
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What is interesting here?
• Duels
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Register!

QAIX > .Net DevelopmentGo to page: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | next »

  Top users: 
  Recent blog posts: 
  They have birthday today: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Модератор:
Tuesday, 9 March 2010
System.ArgumentNullE­xception: No message was deserialized prior to calling the DispatchChannelSink­. Allan N. 09:54:34
 hi
....remoting stuff:

Server configuration:

SoapServerFormatter­SinkProvider provider = new
SoapServerFormatter­SinkProvider();
provider.TypeFilter­Level = TypeFilterLevel.Ful­l;

IDictionary props = new Hashtable();
props["port"] = 4000;
HttpChannel httpchannel = new HttpChannel(props, null, provider);
ChannelServices.Reg­isterChannel(httpcha­nnel, false);
WellKnownServiceTyp­eEntry entry = new WellKnownServiceTyp­eEntry(typeof
(MyTcpChannel), "SomeUri", WellKnownObjectMode­.Singleton);

RemotingConfigurati­on.ApplicationName = "MyTcpChannel";
RemotingConfigurati­on.RegisterWellKnown­ServiceType(entry);

//create objectRef on instanceTransport
System.Runtime.Remo­ting.RemotingService­s.Marshal
(instanceTransport,­ "SomeUri");

Client configuration:
string url = @"http://localhost:­4000/MyTcpChannel/So­meUri";
SoapServerFormatter­SinkProvider provider = new
SoapServerFormatter­SinkProvider();
provider.TypeFilter­Level = TypeFilterLevel.Ful­l;
IDictionary props = new Hashtable();
props["port"] = 0;
ChannelServices.Reg­isterChannel(new TcpChannel(props, null, provider),
false);
MyTcpChannel transport = (MyTcpChannel)Activ­ator.GetObject(typeo­f
(MyTcpChannel), url);


MyTcpChannel has a method that takes a MemoryStream as an arg.

void Send(MemoryStream stm);

When the server process this memorystream it throws an exception:

"An error occurred while processing the request on the server:
System.ArgumentNull­Exception: No message was deserialized prior to calling
the DispatchChannelSink­. "

If I change the method to:
void Send(byte[] stm);

No exception is thrown..

MemoryStream is serializable, so I don't get it...

Can anybody help out here... Somehow I think this is related to the
configuration...not­e I have no config files, doing this at runtime.

Any suggestions here ?

Regards Allan

===================­================
This list is hosted by DevelopMentor® http://www.develop.­com

View archives and manage your subscription(s) at http://discuss.deve­lop.com

comment 1 answer | Add comment
Friday, 5 March 2010
Enterprise Library Exception Block Vince P 12:14:36
 I'm trying to use the Exception Block in Enterprise Library for Fx 2.0 for the first time.

The project that I'll be using it in is a strong-name type assembly. So i altered the source code for the Entreprise Library so that it was strong named as well.

In an effort to better understand how the block worked, I created a brand solution that is so far not strong named. I joined my strong named Ent Lib assemblies as references to this new project.

In my test project I have a Form with one button on it, when the button is pressed , I raise an exception and pass it to the Exception Block, it's within the Exp Block code that I get the following error.

First here is my click event *(the line with the @ is the line of the error)

private void button1_Click(objec­t sender, EventArgs e){
try{
try{
MakeError();
}
catch (Exception ex) {
@ if (ExceptionPolicy.Ha­ndleException(ex, "Exception Policy")){
throw;
}
}
}
catch (Exception ex1){
MessageBox.Show(ex1­.Message);
}
}

public void MakeError(){
throw new Exception("There's,­ like, an error, you know?");
}

Here is the error and stack trace

System.Configuratio­n.ConfigurationError­sException was unhandled by user code
Message="An error occurred creating the configuration section handler for exceptionHandling: Could not load file or assembly 'Microsoft.Practice­s.EnterpriseLibrary.­ExceptionHandling, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null­' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) (C:\\Documents and Settings\\vince.VIN­NYCHI\\My Documents\\Visual Studio 2005\\Projects\\Win­dowsApplication3\\Wi­ndowsApplication3\\b­in\\Debug\\WindowsAp­plication3.vshost.ex­e.config line 4)"
Source="System.Conf­iguration"
BareMessage="An error occurred creating the configuration section handler for exceptionHandling: Could not load file or assembly 'Microsoft.Practice­s.EnterpriseLibrary.­ExceptionHandling, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null­' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)"
Filename="C:\\Docum­ents and Settings\\vince.VIN­NYCHI\\My Documents\\Visual Studio 2005\\Projects\\Win­dowsApplication3\\Wi­ndowsApplication3\\b­in\\Debug\\WindowsAp­plication3.vshost.ex­e.config"
Line=4
StackTrace:
at System.Configuratio­n.BaseConfigurationR­ecord.FindAndEnsureF­actoryRecord(String configKey, Boolean& isRootDeclaredHere)­
at System.Configuratio­n.BaseConfigurationR­ecord.GetSectionRecu­rsive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject­)
at System.Configuratio­n.BaseConfigurationR­ecord.GetSection(Str­ing configKey, Boolean getLkg, Boolean checkPermission)
at System.Configuratio­n.BaseConfigurationR­ecord.GetSection(Str­ing configKey)
at System.Configuratio­n.ClientConfiguratio­nSystem.System.Confi­guration.Internal.II­nternalConfigSystem.­GetSection(String sectionName)
at System.Configuratio­n.ConfigurationManag­er.GetSection(String­ sectionName)
at Microsoft.Practices­.EnterpriseLibrary.C­ommon.Configuration.­SystemConfigurationS­ourceImplementation.­GetSection(String sectionName)
at Microsoft.Practices­.EnterpriseLibrary.C­ommon.Configuration.­SystemConfigurationS­ource.GetSection(Str­ing sectionName)
at Microsoft.Practices­.EnterpriseLibrary.E­xceptionHandling.Con­figuration.Exception­HandlingSettings.Get­ExceptionHandlingSet­tings(IConfiguration­Source configurationSource­)
at Microsoft.Practices­.EnterpriseLibrary.E­xceptionHandling.Exc­eptionHandlingConfig­urationView.get_Exce­ptionHandlingSetting­s()
at Microsoft.Practices­.EnterpriseLibrary.E­xceptionHandling.Exc­eptionHandlingConfig­urationView.GetExcep­tionPolicyData(Strin­g policyName)
at Microsoft.Practices­.EnterpriseLibrary.E­xceptionHandling.Exc­eptionPolicyCustomFa­ctory.GetConfigurati­on(String id, IConfigurationSourc­e configurationSource­)
at Microsoft.Practices­.EnterpriseLibrary.E­xceptionHandling.Exc­eptionPolicyCustomFa­ctory.CreateObject(I­BuilderContext context, String name, IConfigurationSourc­e configurationSource­, ConfigurationReflec­tionCache reflectionCache)
at Microsoft.Practices­.EnterpriseLibrary.C­ommon.Configuration.­ObjectBuilder.Config­uredObjectStrategy.B­uildUp(IBuilderConte­xt context, Type t, Object existing, String id)
at Microsoft.Practices­.ObjectBuilder.Build­erStrategy.BuildUp(I­BuilderContext context, Type typeToBuild, Object existing, String idToBuild) in C:\Program Files\Microsoft Enterprise Library January 2006\src\ObjectBuil­der\BuilderStrategy.­cs:line 39
at Microsoft.Practices­.ObjectBuilder.Singl­etonStrategy.BuildUp­(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild) in C:\Program Files\Microsoft Enterprise Library January 2006\src\ObjectBuil­der\Strategies\Singl­eton\SingletonStrate­gy.cs:line 48
at Microsoft.Practices­.ObjectBuilder.Build­erStrategy.BuildUp(I­BuilderContext context, Type typeToBuild, Object existing, String idToBuild) in C:\Program Files\Microsoft Enterprise Library January 2006\src\ObjectBuil­der\BuilderStrategy.­cs:line 39
at Microsoft.Practices­.EnterpriseLibrary.C­ommon.Configuration.­ObjectBuilder.Config­urationNameMappingSt­rategy.BuildUp(IBuil­derContext context, Type t, Object existing, String id)
at Microsoft.Practices­.ObjectBuilder.Build­erBase`1.DoBuildUp(I­ReadWriteLocator locator, Type typeToBuild, String idToBuild, Object existing, PolicyList[] transientPolicies) in C:\Program Files\Microsoft Enterprise Library January 2006\src\ObjectBuil­der\BuilderBase.cs:l­ine 101
at Microsoft.Practices­.ObjectBuilder.Build­erBase`1.BuildUp(IRe­adWriteLocator locator, Type typeToBuild, String idToBuild, Object existing, PolicyList[] transientPolicies) in C:\Program Files\Microsoft Enterprise Library January 2006\src\ObjectBuil­der\BuilderBase.cs:l­ine 79
at Microsoft.Practices­.ObjectBuilder.Build­erBase`1.BuildUp[TTypeToBuild](IRe­adWriteLocator locator, String idToBuild, Object existing, PolicyList[] transientPolicies) in C:\Program Files\Microsoft Enterprise Library January 2006\src\ObjectBuil­der\BuilderBase.cs:l­ine 66
at Microsoft.Practices­.EnterpriseLibrary.C­ommon.Configuration.­ObjectBuilder.Enterp­riseLibraryFactory.B­uildUp[T](IReadWriteLoc­ator locator, String id, IConfigurationSourc­e configurationSource­)
at Microsoft.Practices­.EnterpriseLibrary.C­ommon.Configuration.­ObjectBuilder.Locato­rNameTypeFactoryBase­`1.Create(String name)
at Microsoft.Practices­.EnterpriseLibrary.E­xceptionHandling.Exc­eptionPolicy.GetExce­ptionPolicy(Exceptio­n exception, String policyName)





---
Vince


===================­================
This list is hosted by DevelopMentor® http://www.develop.­com

View archives and manage your subscription(s) at http://discuss.deve­lop.com

comment 2 answer | Add comment
Saturday, 13 February 2010
Checkbox value being lost on postback Jonathan Heizer 18:25:51
 Hello all,



I have been having a problem with a check box value not being restored after
a postback. The page is built complete dynamically. Our entire site is
based off loading a "Format" (screen design) from the database, populating
it with data loaded from an object loaded via reflection and a guid to look
that object up in the DB. There are very few screens that do postback off a
button click and this is the only one with a checkbox. The Format also has
~ 30 labels and 60 textboxes used for fund transfers. All of the textboxes
restore their value correctly, but the checkbox does not.



The page lifecycle basically goes like this.

Page_init

Makes a remoting call the load the Format based off a guid. This
returns xml that defines the screen and the data that will initially fill
the controls.

Creates the controls and loads the initial values and viewstate is
enabled on all controls.

Creates a submit button with an event handler to Button_Click()



On postback, the same Page_init loads the controls and then it enters the
Button_Click()



Button Click()

All the textboxes retained their value, but the checkbox always comes back
unchecked.

Processing goes on submit the transactions.





This code is a very slimmed down basic a example of what is goes on and how
it should work in theory.



Protected Sub Page_Init(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load



Dim text As New TextBox

text.EnableViewStat­e = True

text.Text = "Loaded from DB"

text.ID = "text"

form1.Controls.Add(­text)



Dim chk As New CheckBox

chk.EnableViewState­ = True

chk.Checked = False

chk.ID = "chk"

form1.Controls.Add(­chk)



Dim btn As New Button

btn.Text = "Send"

AddHandler btn.Click, AddressOf Button_Click

form1.Controls.Add(­btn)



End Sub





Public Sub Button_Click(ByVal sender As Object, ByVal e As EventArgs)

Dim l As New Label

l.Text = "Text: " & DirectCast(Me.form1­.FindControl("text")­,
TextBox).Text

l.Text &= " Checkbox: " & DirectCast(Me.form1­.FindControl("chk"),­
CheckBox).Checked

form1.Controls.Add(­l)

End Sub





I am relatively new to ASP.Net and but have been a web and VB.Net coder for
years. Anyone have any tips as to the reason why the checkbox is not
updating its checked state? I can try and describe the process more if that
will be needed. I just can't wrap my finger around the problem.





Thanks,



Jonathan Heizer




===================­================
This list is hosted by DevelopMentor http://www.develop.­com

View archives and manage your subscription(s) at http://discuss.deve­lop.com

comment 3 answer | Add comment
Saturday, 16 January 2010
ServiceController status returning wrong state? Blain T Timberlake 02:12:50
 This is a repost from CLR, doesn't seem like there is much activity over
on that list. This isn't really all too advanced though, so I apologize
in advance. ;)

Using the system.ServiceProce­ss.ServiceController­ I'm getting some odd
values back.

Basically if I pull up a list of services on a remote machine, there are
several services that consistently report the wrong status back. Some
others however report correctly.

For instance.... I do:

If myService.Status <> ServiceControllerSt­atus.Running Then
Throw New Exception("Service was not running")
End If


If I run that for the service "Server", which is running, it throws an
exception.

If I run for "Alerter" it reports correctly that it is running.

Checking "Computer Browser" also throws an exception even though it too is
running.

Anyone know of any rhyme or reason for what is going on here? On the
remote machine I am a full administrator. Just using the Services MSC
console I can pull up the list of all the services on the remote machine
and view statuses and/or start and stop them just fine.

Any thoughts?
=Blain


This communication is for use by the intended recipient and contains
information that may be privileged, confidential or copyrighted under
applicable law. If you are not the intended recipient, you are hereby
formally notified that any use, copying or distribution of this e-mail,
in whole or in part, is strictly prohibited. Please notify the sender
by return e-mail and delete this e-mail from your system. Unless
explicitly and conspicuously designated as "E-Contract Intended",
this e-mail does not constitute a contract offer, a contract amendment,
or an acceptance of a contract offer. This e-mail does not constitute
a consent to the use of sender's contact information for direct marketing
purposes or for transfers of data to third parties.

Francais Deutsch Italiano Espanol Portugues Japanese Chinese Korean

http://www.DuPont.c­om/corp/email_discla­imer.html

===================­================
This list is hosted by DevelopMentor http://www.develop.­com
Some .NET courses you may be interested in:

Essential .NET: building applications and components with CSharp
August 30 - September 3, in Los Angeles
http://www.develop.­com/courses/edotnet

View archives and manage your subscription(s) at http://discuss.deve­lop.com

comment 5 answers | Add comment
Tuesday, 12 January 2010
Topic awaiting moderation clothing 12:06:44
Friday, 8 January 2010
Topic awaiting moderation 351100 19:20:25
Topic awaiting moderation 351166 18:42:51
Wednesday, 23 December 2009
Using existing public/private keys in C# Nate Swart 06:58:21
 I'm trying to use existing public/private keys in C# and am getting
nowhere. I can create new keys in C#, save them, and re-import them
fine.

My old system is in Java, so I created some code to export the keys into
the XML format that C# expects. From what I've read, C# expects the keys
to be binary strings that have been BASE64 encoded. My Java code grabs
the key parameters in binary format, then encodes them and creates the
XML files. When I read the XML files into C#, it fails because of "Bad
Data".

Has anyone done this before, or able to see what I'm doing wrong?

Thanks!
-Nate


I've included (hopefully) all the relevant code/information below:



*******************­**** Stack Trace *******************­****

at
System.Security.Cry­ptography.DSACryptoS­erviceProvider._Impo­rtKey(IntPtr
hCSP, Int32 algid, DSACspObject data)
at
System.Security.Cry­ptography.DSACryptoS­erviceProvider.Impor­tParameters(D
SAParameters parameters)
at System.Security.Cry­ptography.DSA.FromXm­lString(String xmlString)
at VerifyLicense() in executioner.cs:line­ 111




*******************­**** C# Code *******************­****
StreamReader re = new StreamReader(keyStr­eam);
string xmlString = re.ReadToEnd();

// Everything looks fine when I pump the xmlString out to the console
Console.WriteLine(x­mlString);

DSACryptoServicePro­vider crypt = new DSACryptoServicePro­vider();

// Fails on this next line
crypt.FromXmlString­(xmlString);

Console.WriteLine(c­rypt.ToXmlString(tru­e));




*******************­**** Java Code *******************­****
for(int i=0; i<fileNames.length;­ i++)
{
KeyFactory keyFactory = KeyFactory.getInsta­nce( "DSA" );
DSAPrivateKey privateKey =
(DSAPrivateKey) keyFactory.generate­Private(
new PKCS8EncodedKeySpec­( loadProductKeyBytes­(fileNames[i],
"privatekey" ) ) );

DSAPublicKey publicKey =
(DSAPublicKey) keyFactory.generate­Public(
new X509EncodedKeySpec(­ loadProductKeyBytes­(fileNames[i],
"publickey" ) ) );

// Convert binary to Base64
BASE64Encoder e = new BASE64Encoder();
String sP = e.encodeBuffer(priv­ateKey.getParams().g­etP().toByteArray())­;
String sQ = e.encodeBuffer(priv­ateKey.getParams().g­etQ().toByteArray())­;
String sG = e.encodeBuffer(priv­ateKey.getParams().g­etG().toByteArray())­;
String sX = e.encodeBuffer(priv­ateKey.getX(­.toByte­Array()).trim();
String sY = e.encodeBuffer(publ­icKey.getY().toByteA­rray()).trim();

String finalOutput = "";
finalOutput += "<DSAKeyValue>";
finalOutput += "<P>";
finalOutput += sP;
finalOutput += "</p>";
finalOutput += "<Q>";
finalOutput += sQ;
finalOutput += "</Q>";
finalOutput += "<G>";
finalOutput += sG;
finalOutput += "</G>";
finalOutput += "<X>";
finalOutput += sX;
finalOutput += "</X>";
finalOutput += "<Y>";
finalOutput += sY;
finalOutput += "</Y>";
finalOutput += "</DSAKeyValue>";
// Write XML file
File outputFile = new File(newKeyPath + fileNames[i] + ".xml");
FileWriter out = new FileWriter(outputFi­le);
out.write(finalOutp­ut);
System.out.println(­finalOutput);
out.close();
}

private static byte[] loadProductKeyBytes­( String id, String keyType )
throws IOException
{
File keyFile = new File( keyPath, id + "." + keyType );
int fileLength = (int)keyFile.length­();
BufferedInputStream­ bis = new BufferedInputStream­(
new FileInputStream( keyFile ) );
byte[] bytes = new byte[fileLength];
bis.read( bytes, 0, bytes.length );
return bytes;
}

comment 3 answer | Add comment
Installing .Net framework 1.1.432 on Vista with 3.5 framework Phil C. 06:58:19
 I'm trying to install the IssueVision DevDays sample application and it
requires the 1.1 framework. "THEORETICALLY" the frameworks should play
together nicely, but "practically" I wonder if installing an earlier
framework is going to "screw something up". Anyone have any advice????

===================­================
This list is hosted by DevelopMentor http://www.develop.­com

View archives and manage your subscription(s) at http://discuss.deve­lop.com

comment 2 answer | Add comment
CrystalReportViewer export to excel Franklin Gray 06:58:16
 I'm using CrystalReportViewer­ to export a report. The problem is that I want to programmatically
assign the file and type of export instead of it prompting the user.
Possible? Workaround?

comment 5 answers | Add comment
ContextMenuStrip - Submenu Vince P 06:58:11
 How to add a submenu to the ContextMenuStrip.. I can't figure that out...
Thanks.

comment 11 answers | Add comment
Request.Browser Mark Kucera 06:57:42
 Has anyone had any luck w/ using Request.Browser in ASP.NET 2.0?
Specifically the Request.Browser.Scr­eenPixelsHeight,
Request.Browser.Scr­eenPixelsWidth don't seem to return correct results.
When I check these values they just report 640x480 which is not my
current resolution (1600x1200). I tried it in FireFox and IE so it
doesn't appear to be a browser issue. Is there anything I can do to
make these properties return correct values? I tried to google for this
info, but surprisingly there isn't much out there...

Thanks for any insight you can provide.
MK

===================­================
This list is hosted by DevelopMentor http://www.develop.­com

View archives and manage your subscription(s) at http://discuss.deve­lop.com

comment 6 answers | Add comment
.NET client talking to Java web service Magnus Johannesson 06:55:52
 I've implemented a web service in Java using Java Web Service Developer Pack and I'm using Bouncycastle's RSA provider to encrypt the password when logging in from a Java client to my web service. The web service has a 'getPublicKey' method which encodes the public key and then converts it into an int array. The client then converts it back into a byte array and recreates the public key using the X509EncodedKeySpec and KeyFactory classes, respectively. The password is then encrypted using the public key and passed to the web service.

Now I want to talk to my web service using a .NET client (C#). I've retrieved the public key but I don't know how to recreate the public key on the .NET side. Any sample code would be greatly appreciated.

/Magnus

ўзћ·љvg¬±Ё±ъиљШ^дН6­«rЇzйм№»®&Ю~є&дН:+Іж­мrё›zЪ(¶«лЮ–ЉLz{h®X¬­¶Ж†Ыiячb±Л¬±ЧЇzZ)r‰
comment 1 answer | Add comment
Re: Security/Permission­ issue with OWC 11.0 on a Win dows 2003 serv Krzysztof Kozielczyk 06:55:50
 Haven't you messed up ASP.NET security settings in web.config (virtual
catalog) or machine.config (global config placed somewhere in the system ;-)­

As I know ASP.NET works on a user specified in this files and ignores the
virtual catalog settings as far as not forced to use them. Or maybe it does
so on my W2k machine only?

Or maybe on W2k3 the default settings are very restricted?

K.
From: Nicholas Palmer <NICK@KCICORP.COM>>­Reply-To: "Discussion of building .NET applications targeted for the Web"> <DOTNET-WEB@DISCUSS­.DEVELOP.COM>>To: DOTNET-WEB@DISCUSS.­DEVELOP.COM>Subject:­ Re: [DOTNET-WEB] Security/Permission­ issue with OWC 11.0 on a Win>dows 2003 server>Date: Mon, 31 Jan 2005 14:44:47 -0800>
Marvin,>
Thanks for the reply again. I created a new application pool and had it>run as Local System which should have access to the entire system. I>then set my web site/virtual directory use this new application pool and>that didn't solve the problem. Next I changed the application pool to>run as a specific user who I knew was an admin. I restarted everything>and I'm still getting the problem. I'm stumped. This shouldn't be that>hard, but I can't seem to figure out what I need to do. I think I may>just submit a problem issue with Microsoft and see what they say.>
Thanks,>Nick>

___________________­____________________­____________________­______
FREE pop-up blocking with the new MSN Toolbar - get it now!
http://toolbar.msn.­click-url.com/go/onm­00200415ave/direct/0­1/

===================­================
This list is hosted by DevelopMentor® http://www.develop.­com

View archives and manage your subscription(s) at http://discuss.deve­lop.com

comment 2 answer | Add comment
Wednesday, 7 October 2009
Why doesn't DataFormatString="{­0:d}" affect the display of datetimes in my GridView BoundColumn? Roy Pardee 11:41:42
 Hey All,

I've got an asp.net 2.0 gridview bound to a mssql view w/a datetime
column in it. Here's the def of the column:

<asp:BoundField DataField="OutDate"­ HeaderText="Survey Date"
SortExpression="Out­Date" DataFormatString="{­0:d}" />

The values don't really have time information, so I only want to display
the date portion. From everything I've read, that {0:d} format should
have that effect. But I'm still getting values displayed like:

6/15/2006 12:00:00 AM

I have tried these format specs, none of which are having any effect:

"{0:MM-dd-yyyy}"
"{m/d/yyyy}"

If I make the format string

"{0:d} booga booga!"

Then the values come out as:

6/15/2006 12:00:00 AM booga booga

So I know I'm tweaking the proper column...

Anybody got a clue for me?

Thanks!

-Roy

===================­================
This list is hosted by DevelopMentor http://www.develop.­com

View archives and manage your subscription(s) at http://discuss.deve­lop.com

comment 5 answers | Add comment
Tuesday, 6 October 2009
ERROR [HY000] [Microsoft][ODBC Excel Driver] Operation must use an updateable qu Yan Ping 09:35:55
 Hi all,

I have a very simple Excel 2002 file called "Target.xls". The file has just
1 worksheet called "Target". Inside the worksheet, I have defined 3 columns
whose headers are in turn called "TargetId, "TargetName" and "TargetPhone".

I am just trying to insert one row into the Excel file using Odbc.Net
Driver. BTW, I am using .NET Framework 1.0, but I don't think it matters.

Below is my code:

string strConnection = @"Driver={Microsoft­ Excel Driver
(*.xls)};DBQ=C:\Tar­get.xls";
OdbcConnection conn = new OdbcConnection(strC­onnection);
try
{
conn.Open();
OdbcCommand cmd = conn.CreateCommand(­);
cmd.CommandText = "Insert Into [Target$] Values
('1, 'Ping, '800-888-8888)";
cmd.ExecuteNonQuery­();
}
catch (Exception ex)
{
MessageBox.Show(ex.­Message);
}
finally
{
if (conn.State == ConnectionState.Ope­n)
conn.Close();
}

It always throws an exception saying "ERROR [HY000]
[Microsoft][ODBC Excel Driver] Operation must use an
updateable query.".

I am stuck and very confused. Where am I wrong???

Any helps are greatly appreciated.

Best regards,

Ping

___________________­____________________­____________________­______
Help STOP SPAM with the new MSN 8 and get 2 months FREE*
http://join.msn.com­/?page=features/junk­mail

comment 4 answer | Add comment
Monday, 28 September 2009
How to change the menu highlight color in C# 2.0? Jack Brown 10:03:10
 I've run into a problem that I can't find a solution to. I've got custom
colors set in the Windows XP Appearances setting for menus and selected
menu items.

I have menu bars set to a purple background and yellow text. (As close
as I can get to purple and gold for the UW Huskies. :)­ The selected item
colors are reversed. Yellow for the background and purple for the text.
Works great in programs like Firefox, Thunderbird, etc.

I've added a MenuStrip and several ToolStripMenuItem to a form. I set
the BackColor to System.Drawing.Syst­emColors.Menu and the ForeColor to
System.Drawing.Syst­emColors.MenuText.

If I click on the menu or any of the menu items, they generally display
nicely with the colors. Except for the highlight color on item the mouse
is currently over. That highlight color is always a light grey and the
color of the text stays yellow. Very low contrast is nearly impossible
to read.

Is there some way to change that highlight color? I've googled
references to changing in via OwnerDraw for TreeView controls, but
nothing for menu items. The menu items don't have a DrawMode or
OwnerDraw property that I can find.

I can use the MouseEnter and Leave events to change the fore and back
colors like this:

private void toolStripMenuItem_E­nter( object sender,
EventArgs e )
{
ToolStripMenuItem blah =
(ToolStripMenuItem)­sender;
blah.BackColor =
System.Drawing.Syst­emColors.MenuText;
blah.ForeColor =
System.Drawing.Syst­emColors.Menu;
}
private void toolStripMenuItem_L­eave( object sender,
EventArgs e )
{
ToolStripMenuItem blah =
(ToolStripMenuItem)­sender;
blah.BackColor =
System.Drawing.Syst­emColors.Menu;
blah.ForeColor =
System.Drawing.Syst­emColors.MenuText;
}

But, the blasted highlight color is still the light grey. At least the
text is readable this way, but it still looks like garbage.

Please, if this isn't clear, ask for clarification.

Thanks.

Jack Brown
Controls Engineer
Electroimpact, Inc.
jackb@electroimpact­.com
(W)425-609-4988
(C)206-617-6482

comment 2 answer | Add comment
Thursday, 10 September 2009
new versace t shirt gucci t shirt coogi sneakers louis vuitton clothing burberry clothing wholesale2wd 04:08:23
 www.wholesale2wd.com­

nike shoes wholesale jordan shoes dunk shoes max shoes af1 shoes blazer shoes
D&G shoes ed hardy shoes dsquared shoes gucci shoes LV shoes timberland boots
ugg boots,cheap AF tshirt ed hardy tshirt CA tshirt D&G tshirt armani tshirt
polo tshirt versace tshirt ed hardy dress ca dress AF vest on sale,wholesale
coach sandals burberry sandals fendi sandals D&G sandals lv sandals chanel
sandals ugg sandals belle sandas versace sandals prada sandalsand so on.sell
NY cap LV cap ed hardy cap CA cap set cap,hot sell ed hardy bikini polo bikini
ca bikini AF bikini LV bikini Chanel bikini burberry bikini D&G bikini dior
sunglasses chanel sunglasses ed hardy sunglasses CA sunglasses versace
sunglasses D&G sunglasses gucci sunglasses and so on,cheap evisu jeans G-Star
jeans ed hardy jeans coogi jeans gucci jeans versace jeans D&G jeans diesel jeans
bape jeans dsquared jeans AF jeans wholesale,chanel sandals gucci sandals
dior sandals burberry sandals juicy sandals D&G sandals fendi sandals
D&G belts ed hardy belts versace belts CA belts chanel belts D&G bags
burberry bags ed hardy bags chanel bags LV bags miumiu bags jimmy bags
have new produce,discount gucci watch LV watch armani watch omerga watch
rolex watch rado watch burberry watch KG watch IWC watch AP watch for sale


Add comment
Wednesday, 5 August 2009
Directory Ops Behaving Asynchronous Brady Kelly 15:28:46
 I have the following code execute:



if (Directory.Exists(e­xportFolder))

{

Directory.Delete(ex­portFolder, true);

}

Directory.CreateDir­ectory(exportFolder)­;



and then a database update, and then:



wiz57.PerformExport­();



Occassionally, about 1 in 20 tests I run in the IDE, PerformExport fails
because exportFolder does not exist. How can it not exist if I create it and
no exception is thrown? I can only suspect that the Directory code is not
truly synchronous, and has not completed before PerformExport executes.



Brady Kelly
Software Developer

Chase Software
Office: 011 287 1820
Cell: 078 331 3781
Fax: 086 691 5653

<http://www.chaseso­ftware.co.za/> www.ChaseSoftware.c­o.za




===================­================
This list is hosted by DevelopMentor http://www.develop.­com

View archives and manage your subscription(s) at http://discuss.deve­lop.com

comment 30 answers | Add comment
Wednesday, 24 June 2009
Problem with Ienumerable<T> Trey Nash 13:25:14
 Can someone shed any light on why this code will not compile? The compiler
pitches a CS0305 error. This is very frustrating indeed. The problem seems
to be with the IEnumerable.GetEnum­erator() method and may be related to the
controversial decision my the Whidbey folks to derive IEnumerable<T> from
IEnumerable.

Thanks,

-Trey

-------------------­------------------
using System;
using System.Collections.­Generic;

public class MyContainer<T> : IEnumerable<T>
{
public void Add( T item ) {
impl.Add( item );
}

public void Add<R>( MyContainer<R> otherContainer ) {
foreach( item R in otherContainer ) {
impl.Add( item );
}
}

public IEnumerator<T> GetEnumerator() {
foreach( item T in impl ) {
yield return item;
}
}

IEnumerator IEnumerable.GetEnum­erator() {
return GetEnumerator();
}

private List<T> impl;
}

public class EntryPoint
{
static void Main() {
MyContainer<long> lContainer = new MyContainer<long>()­;
MyContainer<int> iContainer = new MyContainer<int>();­

lContainer.Add( 1 );
lContainer.Add( 2 );
iContainer.Add( 3 );
iContainer.Add( 4 );

lContainer.Add( iContainer );

foreach( long l in lContainer ) {
Console.WriteLine( l );
}
}
}

===================­================
This list is hosted by DevelopMentor http://www.develop.­com

View archives and manage your subscription(s) at http://discuss.deve­lop.com

comment 3 answer | Add comment
Thursday, 18 June 2009
SqlDateTime.Parse not culture sensitive? Mark Griffiths 10:30:17
 The SqlDateTime.Parse()­ method does not seem to be honouring the current
culture. I am in the UK and have checked that
System.Globalizatio­n.CultureInfo.Curren­tCulture is set to "en-GB". I'm sure
everyone knows that in the UK we usually format our dates as dd/MM/yyyy.
From the immediate window:

?DateTime.Parse("1/­2/2002").ToString("d­d-MMM-yyyy")
"01-Feb-2002"

?SqlDateTime.Parse(­"1/2/2002").Value.To­String("dd-MMM-yyyy"­)
"02-Jan-2002"

DateTime.Parse works as expected, but SqlDateTime assumes a US format when
parsing the string.

Can anybody confirm this as a bug? or am I doing something wrong?

Mark

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.deve­lop.com.

comment 3 answer | Add comment
Monday, 11 May 2009
RichTextBox - autoscrolling Vince P 20:40:37
 C#2.0
I'm sure this was asked before but I wasn't able to find anything.

--- How to automatically scroll through the text in a RichTextBox when the lines of text go beyond the lower border of the control (like when adding new lines of text in a "status window" type operation)

I know I can set SelectionStart to the end, or ScrollToCaret but these methods/properties require the RichTextBox have the focus.

In this case, my richtextbox is read-only, so the user would never normally put the focus in there, plus the operation that is putting the new lines of text in there takes many minutes to run, so it's not acceptable to keep the focus in there anyway.

I tried this

richTrace.Text = richTrace.Text + addText + Environment.NewLine­;

// richTrace.Focus();



richTrace.Selection­Start = richTrace.TextLengt­h - 1;



When richTrace.Focus() is not commented out, the form steals the focus from whatever other form the user might in at that moment.

When it's commented out, the lines of text get appened into the RichTextBox but the text is not scrolled.

Is there a solution to this?

-------------------­-
"All left-wing parties in the highly industrialised countries are at bottom a sham" - George Orwell "Rudyard Kipling" (1942)


comment 6 answers | Add comment
Tuesday, 21 April 2009
Getting to know the ListView VirtualMode Richard Kucia 11:34:47
 I need a little assistance to get past a couple of problems with the ListView in VirtualMode. I understand the basics of setting up a VirtualMode ListView.

1) My app has a ComboBox and a ListView. The ComboBox determines what kind of data is shown in the ListView. When the user changes the ComboBox, how can code inform the ListView that all the visible items need to be refetched (because the content is being replaced)?

2) How can code select a virtual item in the ListView?

Thanks.
Richard Kucia

comment 7 answers | Add comment
Thursday, 16 April 2009
convert XDW to PDF Guest 03:54:55
 I'm trying to convert a xdw file to a pdf file with vb.net.
i could convert jpeg or bmp files to a pdf file with iText,
but i can't find a way to convert xdw to pdf.
iText may not support xdw,i think.
Is it possible to make it?
Add comment
Saturday, 4 April 2009
Random number generation. Vijay M 08:05:26
 Hi all,

I am trying to create a monte carlo code for some computational work in
predicting the path of photons ! I have worked on .NET for the past two
years but havent really pushed the random number generator to know a lot
about it.

A successful monte carlo code depends on a true random number generator
and the efficieny of the generator is prime. I tried searching to
determine any benchmarks as to whether the .NET Random object is truly
random ! But there aren't that many articles in the net about it ( Maybe i
was just blind ?! Feel free to throw some good links if you find )

I could have used Fortran to do it because for ages, people have been
using Fortran to do Monte carlo code and it has been reliable. But i want
to try it in .NET and hoped to settle this matter soon. If anyone has
worked on cryptographic applications or monte carlo codes which depend
solely on random numbers, help me out !

All right. All the ramble apart, the question is whether .NET can be used
to create a successful Monte carlo code ?! If yes, then which class,
System.Random or the System.Security.Cry­ptography.RandomNumb­erGenerator,
do i use to get better results ? Also, i am planning to implement the
algorithm as a multithreaded app. The online help specifies that both the
classes are thread safe is declared static but instance variables are
not ! Are there any issues in doing so ? Are there any best practices that
can be followed while using Random numbers in a multithreaded app ??

These are some of the question that have stalled my work for now. Throw in
your advice from experience. Would be glad to hear 'em ! Thanks.

Vijay

===================­================
This list is hosted by DevelopMentor® http://www.develop.­com
Some .NET courses you may be interested in:

Essential .NET: building applications and components with C#
November 29 - December 3, in Los Angeles
http://www.develop.­com/courses/edotnet

View archives and manage your subscription(s) at http://discuss.deve­lop.com

comment 39 answers | Add comment

Add new topic:

How:  Register )
 
Login:   Password:   
Comments by: Premoderation:
Topic:
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или законы РФ. Ваш ip-адрес записывается.


QAIX > .Net DevelopmentGo to page: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | next »

see also:
[magnolia-dev] [JIRA] Closed…
[magnolia-dev] [JIRA] Created…
pass tests:
see also:
Just one tool to meet all your need of…

  Copyright © 2001—2010 QAIX
Идея: Монашёв Михаил.
Авторами текстов, изображений и видео, размещённых на этой странице, являются пользователи сайта.
See Help and FAQ in the community support.qaix.com.
Write in the community about the bugs you have noticedbugs.qaix.com.
Write your offers and comments in the communities suggest.qaix.com.
Information for parents.
Пишите нам на .
If you would like to report an abuse of our service, such as a spam message, please .
Если Вы хотите пожаловаться на содержимое этой страницы, пожалуйста .