|
hu_kh00 wrote: I need deal with very big number
Try one of the BigInt[^] implementations
I are Troll
|
|
|
|
|
IIRC Microsoft J#[^] has a BigInt implementation that can be used by any .NET language. It looks like they're dropping j# so get it while you can!
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
J# has lost all support long ago. I did use its BigInt on occasion.
There finally is a bit integer type in .NET, I haven't tested it yet, I'll wait for an official 4.0 release...
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|
I used to divide bit-by-bit with the standard binary long division, which gives the quotient and the remainder at the same time. But there are faster ways, such as SRT division (quite complicated though)
|
|
|
|
|
I have a problem...
public delegate MyDelegate()
class MDIParent
{
public event MyDelegate myEvent;
public MDIParent() //Constructor
{
// Create and open MDIChild from MDIParent Constructor
MDIChild mdiForm = new (MDIChild())
}
Class MDIChild
{
public MDIChild //Constructor
{
((MDIParent)this.MdiParent).myEvent += new MyDelegate(myPriveteMethod);
}
}
Well, as you can see, I
- Auntomatcally create a MDIChild from MDIParent constructor
- In the MDIChild constructor I try to suscribe to an MDIParent event
It gives me a SystemNullException. It perfectly suscribes if I do it OUTSIDE the MDIChildForm constructor. I suppose it is becouse parent form is not still initialized (child is created form INSIDE parent's constructor).
I need to open MDIChild from the begginig, and suscribe to event at the begginning, too. Any workaround to do this without using the constructor
Thanks!
|
|
|
|
|
Kaikus wrote: Auntomatcally
You're defining extended relationships in your code.
|
|
|
|
|
How about passing MDIParent instance into MDIChild 's constructor?
class MDIParent
{
public event MyDelegate myEvent;
public MDIParent()
{
MDIChild mdiForm = new MDIChild(this);
}
Class MDIChild
{
public MDIChild(MDIParent parent)
{
parent.myEvent += new MyDelegate(myPriveteMethod);
}
}
Best wishes,
Navaneeth
|
|
|
|
|
The issue is that the MdiParent is not set within the construction of your child window. It's a property you set after the MDIChild has been created. You could create a register method on your child class and after you've set the MDIParent of the class, call MDIChild.Register( ).
Not the best way, I'm certain, however it would do what you needed.
|
|
|
|
|
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
|
|
|
|