|
Thanks!
I knew that was the problem. Parent was not completely set becouse I tried to suscribe inside child constructor, wich was invoked from the parent constructor.
I tried your suggestion. It worked! But, how, and when to suscribe?
Today morning, after a good rest, everything came clear. I just moved the suscription to the Forn_Load event
Thanks!
|
|
|
|
|
Hi,
Can anyone let me know How to make Shapes window invisible through programmatically.
Thanks in advance.
|
|
|
|
|
I got the answer. Below is the solution
Microsoft.Office.Interop.Visio.Application vsoApplication = vsoDocument.Application;
vsoApplication.ActiveWindow.Windows.get_ItemFromID((int)Visio.VisWinTypes.visWinIDShapeSearch).Close();
|
|
|
|
|
Hi
I have installed sql sever 2008 first then SQL Server 2005.
Now when i connect with dot(.) in sql server 2008 it works fine
but when i try to connect to sql sever 2005 with dot(.) or local it doesnt works!
What should i do?
|
|
|
|
|
Probably post in the SQL forum. What do you mean dot(.)? If you've got them side by side then you'll have different instances. The instance will be part of the connection string.
Regards,
Rob Philpott.
|
|
|
|
|
1)sorry .I didnt find SQL forum.
2)dot(.) ===> . instance or local
3)where i can find instances of sql server 2005
|
|
|
|
|
Each instance of SQL Server on a system must have a unique name.
|
|
|
|
|
Hello
We have a asp.net website that has reference to simIO.dll which was developed by my predecessor. I have the source project of simIO.dll in hand. This inturn refers to a 3rd party dll called config.dll (using DllImport). Now the 3rd party has released a newer version of config.dll that I need to update in our website.
I first tried to replace the new version of config.dll in the system32 folder and got the following error.
The specified module could not be found. (Exception from HRESULT: 0x8007007E) can not be loaded.
But it works fine with the older version config.dll
Can somebody advise me how to change the reference to the new dll?
Many thanks
Kit
|
|
|
|
|
In the simIO project you need to replace the reference to the old config.dll with the new config.dll and then recompile the project, otherwise the simIO.dll will try to call the old config.dll which has been replaced.
Learning without thought is labor lost; thought without learning is perilous. (Confucius)
|
|
|
|
|
Many thanks for the swift reply.
The simIO project uses
DllImport("config.dll", EntryPoint="ReadWrite@10", CharSet=CharSet.Ansi, SetLastError=true, ExactSpelling=true)
I replaced the config.dll in system32 folder and recompiled simIO and replaced the new simIO.dll in the website. I am unsure whether this is sufficient. How to I change the reference of config.dll in simIO project?
|
|
|
|
|
Nevermind the references in the project if u use DllImport to call the dll.
Try specifing the full path of the dll to see if the dll could be found.
Also try to put in the dll into the bin folder of the project. (If your config.dll resides in the system32 folder,the app that calls the dll should be run in the same folder...)
Learning without thought is labor lost; thought without learning is perilous. (Confucius)
|
|
|
|
|
I tried putting the new version in bin folder. no help.
I'll see whether its possible to include full path of the dll in dllImport
However the last part of ur reply is not clear. What do u mean by my app should reside in system32??
thanks again.
Kit
|
|
|
|
|
I have a class that interops with a booking tool, the class only returns system._ComObjects
I can do late binding cause I know what type is being returned.
public BindingList<NameElement> GetPassengers()
{
BindingList<NameElement> names = new BindingList<NameElement>();
ComClass _comClass = new ComClass();
comClass.RetrieveCurrent();
foreach (NameElement name in comClass.IObj_NameElements)
{
names.Add(name);
}
return names;
}
The problem is that when I try to use this list to bind it to a control by setting it's datasource to this list, the displaymember and valuemember can't be set because I get the error : 'Cannot bind to the new display member.
Parameter name: newDisplayMember'
Calling properties from the NameElement objects is no problem:
Console.WriteLine(names[0].LastName)
I have no clue why the data binding doesn't work ...
Any help is as appreciated.
modified on Wednesday, January 27, 2010 8:40 AM
|
|
|
|
|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using System.Data.Odbc;
using System.Data.Common;
using System.Data;
using System.IO;
namespace sample27
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button2_Click(object sender, EventArgs e)
{
MessageBox.Show("values get inserted");
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
textBox1.Text = "";
textBox2.Text = "";
}
}
class v
{
public static void main(string[] args)
{
string name = null;
string pwd = null;
int i=0;
string connstr = "/*connection string*/"
SqlConnection conn = new SqlConnection(connstr);
conn.Open();
StreamReader sr = new StreamReader(@"e:\v.txt");
string query = "insert into samplereg(username,password) values(@username,@password)";
name= sr.ReadLine();
while (name != null)
{
i++;
SqlCommand cmd = new SqlCommand(query, conn);
cmd.Parameters.Add("@username", name); //error
cmd.Parameters.Add("@password", pwd );
cmd.ExecuteNonQuery();
name = sr.ReadLine();
conn.Close();
}
}
}
}
error:Add(string parametername,object value) has been depricated.use Addwithvalue(String parametername,object value)
pls reply me ......
|
|
|
|
|
Well, the first thing I would try is using the recommended method.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
The second thing I would recommend is reading the suggestions, specifically, about wrapping code blocks in PRE tags.
Cheers,
Vikram. (Got my troika of CCCs!)
|
|
|
|
|
Try using the LiquidNitrogen object.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Don't be so ridiculous.
This is NOT what the LiquidNitrogen class was designed for.
|
|
|
|
|
Well, I was originally going to recommend The InternallyAdjustableThrowoutPiston object, but it's not as widely used, not to mention that LiquidNitrogen object has the same properties because they share the same base class (SpanishInquisition , which nobody expected), and it consumes a lot less memory.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: LiquidNitrogen object has the same properties because they share the same base class (SpanishInquisition, which nobody expected), and it consumes a lot less memory.
I would never have expected that. I was going to recommend using the ILeftHandThread Interface with the StarboardMufflerBearing object, but your solution is clearly better.
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
Hi All,
I want to retrieve SSL Certification status in my C# application.
Can anybody help me?
Thanking You,
Sunil G.
|
|
|
|
|
|
|
Hello anyone..,
How we can differentiate between an encrypted and none encrypted txt???
i need a method for that, to using in my project...,
Please help me.........,,,
An encryption methode is below:
using System;
using System.Collections.Generic;
using System.Text;
using System.Security.Cryptography;
using System.Configuration;
namespace SharpPcap.EnCryptDecrypt
{
public class CryptorEngine
{
public static string Encrypt(string toEncrypt, bool useHashing)
{
byte[] keyArray;
byte[] toEncryptArray = UTF8Encoding.UTF8.GetBytes(toEncrypt);
System.Configuration.AppSettingsReader settingsReader = new AppSettingsReader();
string key = (string)settingsReader.GetValue("SecurityKey", typeof(String));
if (useHashing)
{
MD5CryptoServiceProvider hashmd5 = new MD5CryptoServiceProvider();
keyArray = hashmd5.ComputeHash(UTF8Encoding.UTF8.GetBytes(key));
hashmd5.Clear();
}
else
keyArray = UTF8Encoding.UTF8.GetBytes(key);
TripleDESCryptoServiceProvider tdes = new TripleDESCryptoServiceProvider();
tdes.Key = keyArray;
tdes.Mode = CipherMode.ECB;
tdes.Padding = PaddingMode.PKCS7;
ICryptoTransform cTransform = tdes.CreateEncryptor();
byte[] resultArray = cTransform.TransformFinalBlock(toEncryptArray, 0, toEncryptArray.Length);
tdes.Clear();
return Convert.ToBase64String(resultArray, 0, resultArray.Length);
}
}
}
Regards...
modified on Wednesday, January 27, 2010 6:56 AM
|
|
|
|
|
3bood.ghzawi wrote: How we can differentiate between an encrypted and none encrypted txt???
You can't, not without decrypting. It is possible to perform a preliminary check to see whether the decryption "string" is HEX (which encrypted strings are), but not all HEX strings are encrypted information. The only reliable way is to attempt to decrypt, even then it only checks for the decryption key.
Also this is worrying:
3bood.ghzawi wrote:
string key = (string)settingsReader.GetValue("SecurityKey", typeof(String));
The app config is by-and-large publicly available, and the key *MUST*
be kept secret for the cryptography to be worth anything.
CCC solved so far: 2 (including a Hard One!)
37!?!! - Randall, Clerks
|
|
|
|