|
Hi All
I am not able to open my previously copied project in .Net, When i try to open the webapplication it says " Unable to open the project file from the webserver ".
I have only .Sln file inside my folder. I donot have projectname.vbproj.webinfo file.
But i can create a new project.
Pls help me
Thanks
|
|
|
|
|
Hey everybody!
I have a question. I'm trying to do some dynamic property loading from an xml file. So i know the following things from the xml:
1) the type of the object to initialize
1) what property of the object to initialize
2) the value the property should get in the form of a string
3) the type of the property (i got that one from the propertyinfo)
I know there has to be a method that you pass a type and a string, and it creates the object for you, just like the propertygrid. I don't want to write a huge switch statement...
Example:
<Roundness>5.4</Roundness> ---> blabla.Roundness = 5.4!
Thank you!
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick || Fold With Us! || Pensieve || VG.Net ||
|
|
|
|
|
I'm not exactly sure but do you probably mean Convert.ChangeType(myString, myType); ?
|
|
|
|
|
That was not the method i was looking for, because you can't convert everything from a string that way. But it did help me in the right direction, so thank you very much!
I ended up writing a method by myself, it wasn't so hard as i thought it would be.
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick || Fold With Us! || Pensieve || VG.Net ||
|
|
|
|
|
System.ComponentModel.TypeConverter tc = System.ComponentModel.TypeDescriptor.GetConverter(typeof(ElementType));
Then use tc.ConvertFromInvariantString / tc.ConvertToInvariantString.
Works for int, float, Point, Font, etc...
|
|
|
|
|
Ah TypeDescriptor, that's the one! That is a lot easier than looking for TypeConverterAttributes and stuff. Thank you so much man!
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick || Fold With Us! || Pensieve || VG.Net ||
|
|
|
|
|
Many thanks for your help, worked a treat! If I could ask one more favour, as I am struggling with this at the moment!
I am now trying to register my DLL in the COM+ Catalog. To do this I am taking the manual approach and using the regsvcs.exe tool provided with the .net framwork.
However when I regiser the dll it comes back that I have derived classes found in the assembly and won't register, saying that classes must be public, concrete and have a default constructor. Why is this happening? As far as I'm aware I haven't got any derived classes apart from the serviced component which is required. Below is my code for my class:
using System;
using System.Data;
using System.Data.SqlClient;
using System.EnterpriseServices;
namespace StepByStep7_1
{
public class NorthwindSC : ServicedComponent
{
private SqlConnection sqlcnn;
private SqlDataAdapter sqlda;
private DataSet ds;
public NorthwindSC()
{
// Create a connection to the
// Northwind SQL Server database
sqlcnn = new SqlConnection("data source=(local);initial catalog=Northwind;
User ID = SA;Password = *********");
}
// This method executes a SELECT query and
// returns the results in a DataSet object
public DataSet ExecuteQuery(string strQuery)
{
// Create a SqlDataAdapter object to talk to the database
sqlda = new SqlDataAdapter(strQuery, sqlcnn);
// Create a DataSet object to hold the results
ds = new DataSet();
// Fill the DataSet object
sqlda.Fill(ds, "Results");
return ds;
}
// This method updates the database with the changes in a DataSet object
public int UpdateData(DataSet ds)
{
// Update the database and return the result
SqlCommandBuilder sqlcb = new SqlCommandBuilder(sqlda);
return sqlda.Update(ds.Tables["Results"]);
}
}
}
Many thanks for your help
Paul
|
|
|
|
|
Trying to understand Cryptography so I'm writing a small utility which lets me select a key size and IV size based on the LegalKeySizes and LegalBlockSizes properties of the SymmetricAlgorithm class. If I always use the LegalBlockSizes[0].MinSize, then everything works fine. But if I were to use the code below I get the following error: System.Security.Cryptography.CryptographicException - "Specified initialization vector (IV) does not match the block size for this algorithm".
public void Encrypt(string input, string password)<br />
{<br />
byte[] salt = new byte[]{0x31, 0x7E, 0x54, 0x7C, 0x6D, 0x30, 0x2B, 0x68, 0x79, 0x5E, 0x36, 0x3A, 0x31, 0x30, 0x24, 0x3D, 0x33, 0x76, 0x31, 0x6C};<br />
PasswordDeriveBytes passBytes = new PasswordDeriveBytes(password, salt);<br />
<br />
SymmetricAlgorithm alg = Rijndael.Create();<br />
alg.Key = passBytes.GetBytes(alg.LegalKeySizes[0].MaxSize);<br />
alg.IV = passBytes.GetBytes(alg.LegalBlockSizes[0].MaxSize);
<br />
<br />
}
In fact, if I use any legal block size other than the MinSize I get this error. Why is this?
Thanks,
Mark Miller
|
|
|
|
|
sonu
Jan 20, 9:26 am show options
Newsgroups: microsoft.public.dotnet.general
From: "sonu" <snehal_w...@yahoo.com> - Find messages by this author
Date: 19 Jan 2006 20:26:19 -0800
Local: Fri, Jan 20 2006 9:26 am
Subject: Re: HELP need urgently!!!
Reply | Reply to Author | Forward | Print | Individual Message | Show original | Remove | Report Abuse
What i m tring to do is ,I have a database with tables having paths of
the files on the client machine.Now what i want is on a button click
by the user search all the files on client machine corresponding to the path in the database table and the file path
should replaced by user files that have been searched from the client
machine.
|
|
|
|
|
I have a legacy MFC application which I am trying to port it to .net (using VS 2005).
I was wondering if its a good thing (or bad) to convert all my mfc resources to .net winform to have the look and feel of .net
Is there any downside to this?
Any comments on this?
Thanks
K
|
|
|
|
|
WinForms are too different from MFC to provide any automated tools. Any conversion will have to be a total rewrite.
|
|
|
|
|
check out www.dudelabs.com...
But I have no idea how much rewrite I have to do after converting my mfcs resources...Anyone have experience in using them???
-K
|
|
|
|
|
My sole experience with automated conversion "tools" turned into a total rewrite anyway.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I guess you'll have to try the trial version and investigate.
Kevin
|
|
|
|
|
Hello all
I am developing an application for smartphones in C#, using Microsoft Visual Studio 2003 and the .NET Compact Framework. I have also downloaded the OpenNET CF.
Is there any way of knowing which menu item is selected at any time? (like the event "Select", which it is not supported in the compact framework).
I am really lost, and I needed by yesterday
Many thanks in advance
|
|
|
|
|
I found this wounderful code to scan a image ie TwainGUI in code project.Can anybody tell me how to use TwainGUI in asp.net project.So that it can run on client machine.
|
|
|
|
|
You might want to drop your current project and take a look at something that already support TWAIN in an ASP.NET environment, like this[^] project on SourceForge.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i clicked on the link u gave but there is no file available on this project(TwainNet)
|
|
|
|
|
Teaches me for not checking the Download section myself.
Well, that's about the only FREE component. Everything else charges $,$$$.
You can find a nice list of them here[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have to create this report that displays as follows
Product_ID Sale_Value Cumulative %_of_Totalsales Rating
---------- ---------- ---------- --------------- ------
1 100 100
2 250 350
--------- --------
ToTal: 350
So I want to know how to calculate the Cumulative inside Cristal reports in order to get the % --> PercentageOfSum(,)
All this time I was doing this in C# and inserting the results to the data set but this is very inefficient
Please Help --- IT Is Very Urgent
Mail to -- dnranatunga@yahoo.com
PLEASE HELP!!!!!
|
|
|
|
|
Anyone out there have any GOOD examples or web sites that show hoe to use these?
The Office Object model seems to.... oh I don't know...
SUCK! maybe...
All I want to do is put a border on the bottom of a cell and nothing seems to work...
UGH!
Breathe.. deep... must control fist of death.....
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
My Blog[^]
|
|
|
|
|
I am currently following a book on how to sign assemblies with strong names in order to register a serviced component in the into the COM+ catalog and some errors are occuring.
My AssemblyInfo.cs file currently looks like this: (of importance is the AssemblyKeyFile attriubte)
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.EnterpriseServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("StepByStep7_1")]
[assembly: AssemblyDescription("Retrieve and update data from the Northwind database")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("StepByStep7_1")]
[assembly: AssemblyCopyright("Copyright © 2006")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ApplicationActivation(ActivationOption.Library)]
[assembly: ApplicationName("NorthwindCS")]
[assembly: AssemblyKeyFile(@"..\..\..\70320.snk")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("2d37557e-b619-4092-80e4-4a30e2978021")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
When I build the application I get the following error:
Use command line option '/keyfile' or appropriate project settings instead of 'AssemblyKeyFile'
Can anyone help explain why this error is coming up? The build itself actually does succeed, however it is giving me hassle when I come to register the serviced component in the COM+ catalog. I am presuming that it is because of the error in the build?
I would be very grateful to anyone who can help in order that I may move on in the book as I have just got a second wind to return to my studies and want to make the most of it while it lasts!!!
Thanks
Paul
|
|
|
|
|
Hi Paul,
The way of signing the assembly with key file is changed.
comment out the line "[assembly: AssemblyKeyFile(@"..\..\..\70320.snk")]"
Right click the project and open the properties.
Click on the Signing tab.
Click the "Sign the assembly" - choose the key file over here and save the project
Compile it.
It should solve ur problem.
With Regards,
Shailesh kawade
Knowledge Is Power.
|
|
|
|
|
Many thanks for your help, worked a treat! If I could ask one more favour, as I am struggling with this at the moment!
I am now trying to register my DLL in the COM+ Catalog. To do this I am taking the manual approach and using the regsvcs.exe tool provided with the .net framwork.
However when I regiser the dll it comes back that I have derived classes found in the assembly and won't register, saying that classes must be public, concrete and have a default constructor. Why is this happening? As far as I'm aware I haven't got any derived classes apart from the serviced component which is required. Below is my code for my class:
using System;
using System.Data;
using System.Data.SqlClient;
using System.EnterpriseServices;
namespace StepByStep7_1
{
public class NorthwindSC : ServicedComponent
{
private SqlConnection sqlcnn;
private SqlDataAdapter sqlda;
private DataSet ds;
public NorthwindSC()
{
// Create a connection to the
// Northwind SQL Server database
sqlcnn = new SqlConnection("data source=(local);initial catalog=Northwind;
User ID = SA;Password = *********");
}
// This method executes a SELECT query and
// returns the results in a DataSet object
public DataSet ExecuteQuery(string strQuery)
{
// Create a SqlDataAdapter object to talk to the database
sqlda = new SqlDataAdapter(strQuery, sqlcnn);
// Create a DataSet object to hold the results
ds = new DataSet();
// Fill the DataSet object
sqlda.Fill(ds, "Results");
return ds;
}
// This method updates the database with the changes in a DataSet object
public int UpdateData(DataSet ds)
{
// Update the database and return the result
SqlCommandBuilder sqlcb = new SqlCommandBuilder(sqlda);
return sqlda.Update(ds.Tables["Results"]);
}
}
}
Many thanks for your help
Paul
|
|
|
|
|
Hi All,
Can anybody please help me to know where exactly is gacutil tool in Framework 2.0
Is the tool name changed ? Or the concept of assembly version maintenance is changed.
What is backword compatibilty with Framwork 1.1?
(Note :- I am using released version of Framework 2.0)
Thanks In Advance
Shailesh Kawade
Knowledge Is Power
|
|
|
|