|
Please tell what the problem you are facing. We are not here to write code for you. Supply code snippet or scinario which you are facing problem.
I suggest you should try google first and see how database connection works with c# application and so on.
Mubashir
Software Architect
Storan Technologies Inc, USA
Every job is a self portrait of the person who did it.
|
|
|
|
|
Stoumann wrote: ease help me, i hope you understand what i'm writing..
Your question was easy enough to understand, unfortunately it is not one that can be answered in a single post.
Stoumann wrote:
I'm new at this.
Everyone has to start somewhere! At least you have not shosen a ridiculously difficult first project like "I want to write a face recognistion service that interops with 2 cameras to track movement "
Start by lookin g into ADO.NET - this provides you with database access capabilities. You could also look at DataBinding if its a windows forms app, otherwise look at ASP.NET page lifecycle to discover how to link web controls to data drawn from a database.
|
|
|
|
|
hey Stoumann are you a new Developer.
Have you ever heard of the ADO.Net or just did you google that how to insert people to database using C#.
So first try to google it and get the Articles there are lot of articles are there.
SO try with the articles and then if you have got any problem ie., error tell here.we will help you in solve that problem.
this is not a single step answer to tell in this regards.
Regards,
Satips.
|
|
|
|
|
Hello everybody!
Can someone tell me why the following code comes to the conclusion that using an event instead of a direct method call is about 3 times faster????
Its pretty simple, just copy it at give it a go!
------------------------------------------
public class Class1
{
event TestDelegate TestEvent;
delegate void TestDelegate(String test);
public static void Main(String[] args)
{
//Number of cycles
int n = 10000000;
Class1 c = new Class1();
//register events
c.TestEvent += c.Test;
c.TestEvent += c.Test1;
c.TestEvent += c.Test2;
Console.WriteLine("Calling event {0} times....", n);
DateTime startTime = DateTime.Now;
//Call the event n times
for (int i = 0; i < n;i++ )
{
if(c.TestEvent != null)
c.TestEvent("i = " + i);
}
DateTime stopTime = DateTime.Now;
TimeSpan duration = stopTime - startTime;
Console.WriteLine("Calling normal {0} times....", n);
startTime = DateTime.Now;
//Call the event n times
for (int i = 0; i < n; i++)
{
c.Test("i = " + i);
c.Test1("i = " + i);
c.Test2("i = " + i);
}
stopTime = DateTime.Now;
TimeSpan duration2 = stopTime - startTime;
Console.WriteLine("Event based call took: {0},{1} sec", duration.Seconds, duration.Milliseconds);
Console.WriteLine("Normal call took: {0},{1} sec", duration2.Seconds, duration2.Milliseconds);
double eventTime = duration.Seconds*1000 + duration.Milliseconds;
double normalTime = duration2.Seconds*1000 + duration2.Milliseconds;
Console.WriteLine("Normal calling is about {0} times faster.", eventTime/normalTime);
Console.ReadLine();
}
private void Test(String test)
{
//do sth
int i = 0;
int x = i * 2;
}
private void Test1(String test)
{
//do sth
int i = 0;
int x = i * 2;
}
private void Test2(String test)
{
//do sth
int i = 0;
int x = i * 2;
}
}
------------------------------------------
Thanks in advance!
|
|
|
|
|
Hi,
the difference is
c.Test("i = " + i);
c.Test1("i = " + i);
c.Test2("i = " + i);
does generate three new strings, whereas c.TestEvent("i = " + i);
generates only one.
|
|
|
|
|
Your right, of course! Thanks!
So with the application changed, the result is that using the event mechanism is about 7% slower (for my example application). This seams reasonable.
Steffen
|
|
|
|
|
A main hashtable is populated with a Dictionary entry and several other hashtables with keys and values.
Now I would like to loop through the main hashtable and retrieve the value of each key in each item i.e. hashtables and Dictionary item.
This is what I am trying to do but it gives an error because the first item in the main hashtable is a disctionary entry.
Thanks
foreach (Hashtable ht in Globals.CacheHashTablesMain)
{
}
|
|
|
|
|
Hello,
You have to look for DictionaryEntry in Hashtable.
foreach(DictionaryEntry de in YourHT)
{
//de.Key
//de.Value
}
All the best
Martin
-- modified at 7:57 Tuesday 8th May, 2007
|
|
|
|
|
Hi,
please note that each hashtable inside the main hashtable has many items.
so I think de.value does not work.
Thanks
|
|
|
|
|
Hello,
Ok, I didn't got your question write at first.
You have to iterate to the main hashtable and cast the falues to Hashtable and iterate again threw that, to get your items.
foreach(DictionaryEntry de in MainHashtable)
{
Hashtable subHT = de.Value as Hashtable;
if(subHT!=null)
{
foreach(DictionaryEntry deSub in subHT)
{
}
}
}
To make it look a little more OOP, you could create a recursive method call, but in this special case it's not neccesary as it is not to abstract.
Hope it helps!
All the best,
Martin
|
|
|
|
|
Hi,
It does not pick up the items in the first loop which is dictionary as opposed to hashtable.
|
|
|
|
|
Hello,
arkiboys wrote: It does not pick up the items in the first loop which is dictionary as opposed to hashtable
Sorry, I don't understand what you want to say.
What I understood, is that you have a hashtable full of hastables (subHT) in the Value property.
These subHT store the items you would like to have also in the Value property.
You are not able to get these items over the Key.
Please post the code snipped you have write now!
All the best,
Martin
|
|
|
|
|
Hi,
I need a masked(formatted) edit box in C#, where i can enter the date time like "month/date/year Hours:Minutes:Secods AM/PM" for example "5/9/2007 12:00:00 AM", does any one know how can i do that.
Warm Regards,
Mushq
|
|
|
|
|
See this[^]
Mubashir
Software Architect
Storan Technologies Inc, USA
Every job is a self portrait of the person who did it.
|
|
|
|
|
Try a DateTimePicker instead.
|
|
|
|
|
Hi,
Maybe Smart FieldPackEditor.Net would fit your need. The component is in beta but it is the only flexible DateTimePicker replacement on the scene.
|
|
|
|
|
to display image from a location + c#
|
|
|
|
|
kirangedela wrote: o display image from a location + c#
Though the provided description is not enough. If you want to display an image in PictureBox control, you need to create the object of Image class, fill it with image (From file) and assign to PictureBox control
like,
<br />
Image img = null;<br />
img = img.FromFile("c:\\MyImage.jpg");<br />
PictureBox1.Image = img;<br />
PictureBox1.Update();<br />
Mubashir
Software Architect
Storan Technologies Inc, USA
Every job is a self portrait of the person who did it.
|
|
|
|
|
Hi, how can I access a specific node in a XML document and read its data? Say for example if I have the following XML doc and want to access on Note id;
<Notes>
<Note id="1">
<Title>title</Title>
<Date>date</Date>
<text>text</text>
</Note>
<Note id="2">
<Title>title</Title>
<Date>date</Date>
<text>text</text>
</Note>
</Notes>
/Thanks
|
|
|
|
|
You would most likely want to learn XPath. You can do it without by walking the DOM, but XPath is worth the time it takes to learn it (well, unless you go firectly for some LINQ stuff).
In the simple form, load it into an XmlDocument, then use the SelectNodes/SelectSingleNodes methods available on the document (and all contained elements).
Google for "XPath Tutorial" to figure out how XPath works.
|
|
|
|
|
Thx ill take a look
|
|
|
|
|
I have a problem,take more time to show the details in crystal report.
How we can calculate the expected execution time of the crystal report.
|
|
|
|
|
Hi all,
I've got a small problem when i tried to read DBF files.
I'm using OleDb provider. The problem is i just could read dbf files that have the length of filename which are less than or equal to 8 (not including extension).
I can't understand this.
Thanks a lot
|
|
|
|
|
DBF files are from the age of DOS, hence the 8.3 name limitation. Apparently no one cared to update it, and I doubt they will now as it really shouldn't be used anymore. There might be a decent solution, but my workaround was copying the file to a temp location to get the legal name.
|
|
|
|
|
Hi,
what is database connection string your using.
Check the connection strain properly.
Regards,
Kiran Kumar Singani
The Dream is not what you see in sleep........Dream is the thing which does not let you sleep
|
|
|
|