|
|
pls help me on "how to open a MS word doc in asp.net application"...
|
|
|
|
|
|
Dear Sir,
I am assigned to draw ( with GLUT ) line chart and Bar chart
for ( say = 5 ) inputs. I checked my books and on net , but
could not find any helpful coding.
Therefore I uesd fundamenta method to get to a solution.
I used six line ( Bresenham algo ) segments to define Two
major axes amd foue head - to - tail line ( edges )segments
to define five ( vertices ) Points .
For bar chart , I have drawn five rectangled of a small width
and ordinates to define the height ( parameter ).
The result just fulfills ther intent , but is too crude ,
messy and unpleasant to look at. No parameters or markings .
My query is that ....................
is there any function namely < Draw_BarChart> . like we have
< Draw_Circle> or < Draw_Line> in the library , or custum -
written . At least I
could not locate one.
If there exiats such a function < Tool > , please provu\ide ,e
the link , to work upon. I will be futher obliged , if I can
get < chars> code in C++ or any other version of C .
Thanks ,
ah.
|
|
|
|
|
i want to validate user and password.
i code below:
DirectoryEntry de = new DirectoryEntry(LDAPPath);
DirectorySearcher search = new DirectorySearcher(de);
search.Filter = "(&(objectclass=user)(cn=" + userID + "))";
SearchResult sr = search.FindOne();
if (sr != null)
{
string userDN = sr.Properties["distinguishedname"][0].ToString();
DirectoryEntry de2 = new DirectoryEntry(sr.Path, userDN, password);
try
{
de2.RefreshCache();
Console.WriteLine("success");
}
catch (System.Exception a)
{
Console.WriteLine(a.Message);
}
}
i add a break point at " de2.RefreshCache();"
it always throw an exception when run it and then out put the error maeeage
even userid and password were matched
appreciated for helping
|
|
|
|
|
hi,
i am developing the project in c#.NET . i need to insert the data into SQLSERVER tables using insert command. if any one can help me i would be kindful.
plz give me an sample statement also.
-- modified at 2:02 Friday 12th May, 2006
|
|
|
|
|
http://www.codeproject.com/dotnet/simpledbreadwrite.asp
Hope this will help you.
Best Regards,
Apurva Kaushal
|
|
|
|
|
hi
I have one threat for calculating but i need some progress bar to do visualisation of step of calculation how to do that???
good bye
best regards
|
|
|
|
|
Look in the C# Windows Forms / C# Controls menu here at CodeProject. There is an entire section on Progress Controls.
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum
led mike
|
|
|
|
|
I knoe it how to inset progrss bar in normal program but how to do it in thread???
|
|
|
|
|
You have to tell the ProgressBar to update, but be careful not to directly access UI elements from a different thread than the one they were created in.
So you should define a delegate, for example
private delegate void SetProgressValueDelegate(int val); and a method in your class to update the ProgressBar (its signature must match the delegate):
private void SetProgressValue(int val)
{
progressBar1.Value = val;
}
Then you can safely invoke the method from your thread by calling:
Invoke(new SetProgressValueDelegate(SetProgressValue), new object[] { newValue }); where newValue is the value to set the ProgressBar to.
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
I want to make a WMI explorer but I don`t know some things. I know haw to list elements from a class using WMI SQL(select * from {class}) but I don`t know how to list all namespaces or to list all classes from a namespace. Could anyone provide me a WMI SQL tutorial or some ideas.
|
|
|
|
|
HI,
how to show forms from multiple windows applications into the same container/workspace using Composite UI application block
Thanks in advance,
Narasimha
|
|
|
|
|
I'm sorry I have to write it one more time (this is something like the 3rd time), but no-one has answered and I have to get them figured out! and I will keep posting untill I will have answers, and as you see.... this is REALY ORGENT!
please help me...
1. I'm trying to build my own ICryptoTransform-able (System.Security.Cryptography.ICryptoTransfom) class, so I could use it in CryptoStream. (I searched in codeproject articles and didn't fine something helpful, I promiss that if some-one will help me I will write an article on how to do it!)
I already built the algoritm, and I inherited from ICryptoTransform as they wanted to, and I'm using MSDN to know what methods and properties I need to do, but there are two properties, and two methods that I don't know what to do with them, and what I should return from them... the properties are InputBlockSize AND OuputBlockSize, and the methods are TransformBlock and TransformFinalBlock, I don't know what they need to get (what does every parameter stand for), and what to return, the MSDN doesn't help me very much in here.
If anyone can tell me what to do in them, and even give me an exemple I would appriciate it...
2. And one more thing, where can I save information on my application (i.e is registered, setupdate etc...), and how that it won't be able to be changed without my pass or something like that...?
Thanks alot in advance
|
|
|
|
|
<br />
<br />
private void Form1_Load(object sender, System.EventArgs e)<br />
{<br />
Patient PatientData = null;<br />
PatientData.id[0] = 0;
PatientData.Lname[0] = "Smith";<br />
PatientData.Fname[0] = "John";<br />
PatientData.Mname[0] = "Allen";<br />
}<br />
<br />
public class Patient<br />
{<br />
public int[] id = new int[5];<br />
public string[] Lname = new string[5];<br />
public string[] Fname = new string[5];<br />
public string[] Mname = new string[5];<br />
}<br />
The above code produces "Object Reference not set to an instance of an object". I simply want to be able to put 5 values in each variable array. I'm having problem with the first one. Can anyone help?
P.S.- The code compiles fine...
-Kay
-- modified at 23:20 Thursday 11th May, 2006
|
|
|
|
|
You need to create object before assining it properties.
Replace first line in form1_load to this:
<br />
Patient PatientData = new Patient();<br />
Also you can turn your patient class into struct.
Best regards, Alexey.
|
|
|
|
|
Interestingly I just figured it out prior to your posting...HOWEVER....now, I'm having problems accessing the values... I'm checking the values in my immediate window and they are populating fine.... I have a function that I'm passing a parameter (the id) so I can produce the correct values in my testbox.... (see code below)....
However, I'm not getting an error....I'm just getting a 0 in my first field....any help is greatly appreciated....
<br />
private void ShowPatient(int id)<br />
{<br />
Patient PatientData = new Patient();<br />
txt1.Text = PatientData.id[id].ToString();<br />
txt2.Text = PatientData.Lname[id];<br />
txt3.Text = PatientData.Fname[id];<br />
txt4.Text = PatientData.Mname[id]; <br />
}<br />
Thank you again...
-Kay
|
|
|
|
|
Of course, you must initialize this variable first.
Please read some books, about C# and object oriented programming.
Best regards, Alexey.
|
|
|
|
|
lol..ok, is there anyone ELSE that can help me. I know I'm close and I got this far by using books....but I'm taking it beyond what the book example is and that's why I'm on this forum. If anyone can share the knowledge to address this basic problem, I'd greatly appreciate it. Thank you anyway Alex... I'll be sure to share the answer with you once I figure it out.
-Kay
|
|
|
|
|
got it...Here is the functioning code for all those who can benefit from the knowledge... Keep in mind it's just the basic functions and class.... I'm not including all the event... you'll have to fill in the holes...
<br />
private void Form1_Load(object sender, System.EventArgs e)<br />
{<br />
Patient.id[0] = 1;<br />
Patient.Lname[0] = "Smith";<br />
Patient.Fname[0] = "John";<br />
Patient.Mname[0] = "Allen";<br />
}<br />
<br />
public class Patient<br />
{<br />
public static int[] id = new int[5];<br />
public static string[] Lname = new string[5];<br />
public static string[] Fname = new string[5];<br />
public static string[] Mname = new string[5];<br />
}<br />
<br />
private void ShowPatient(int id)<br />
{<br />
txt1.Text = Patient.id[id].ToString();<br />
txt2.Text = Patient.Lname[id];<br />
txt3.Text = Patient.Fname[id];<br />
txt4.Text = Patient.Mname[id]; <br />
}<br />
-Kay
-- modified at 0:28 Friday 12th May, 2006
|
|
|
|
|
Hi!
The suggestion to read some more about OOP is a good idea IMHO.
For example, using static attributes for your Patient is plain wrong - you surely want to deal with more than 1 patient, don't you?
If you do not understand what the keyword static means or that you have to create new instances of objects before you can use them, you'll have a hard time figuring out why your code doesn't do what you want it to do.
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
Mav,
Do you understand what I've done? I now understand what static means(and it appears I understand it better than you) and it's not consistent with your statement. Allow me to enlighten you...
<br />
private void Form1_Load(object sender, System.EventArgs e)<br />
{<br />
Patient.id[0] = 1;<br />
Patient.Lname[0] = "Smith";<br />
Patient.Fname[0] = "John";<br />
Patient.Mname[0] = "Allen";<br />
}<br />
<br />
public class Patient<br />
{<br />
public static int[] id = new int[5];<br />
public static string[] Lname = new string[5];<br />
public static string[] Fname = new string[5];<br />
public static string[] Mname = new string[5];<br />
}<br />
This code means that I can have up to 5 values for each property in that class.
This means I can write:
<br />
Patient.id[1] = 1;<br />
Patient.Lname[1] = "Smith";<br />
Patient.Fname[1] = "John";<br />
Patient.Mname[1] = "Allen";<br />
<br />
Patient.id[2] = 1;<br />
Patient.Lname[2] = "Barker";<br />
Patient.Fname[2] = "Dave";<br />
Patient.Mname[2] = "Barry";<br />
<br />
Patient.id[3] = 1;<br />
Patient.Lname[3] = "James";<br />
Patient.Fname[3] = "Rick";<br />
Patient.Mname[3] = "Franklin";<br />
<br />
Patient.id[4] = 1;<br />
Patient.Lname[4] = "Jones";<br />
Patient.Fname[4] = "Paul";<br />
Patient.Mname[4] = "Alexander";<br />
And anytime I call my:
<br />
private void ShowPatient(int id)<br />
{<br />
txt1.Text = Patient.id[id].ToString();<br />
txt2.Text = Patient.Lname[id];<br />
txt3.Text = Patient.Fname[id];<br />
txt4.Text = Patient.Mname[id]; <br />
}<br />
It will populate the correct patient based on the id being passed in. Hope that helps you understand it better...
Also, Please don't HELP demean people by telling them to go read books. You don't know how many books that person has in front of them when they actually ask for help. You want to place an article...that's fine... but it appears that not everyone who says "Read Books" knows the answer. Truth is... I think "Read Books" is an easy way to not answer the question. This forum is for help... I respectfully ask that you save comments like that for yourself so that valueable messageboard threads aren't wasted on "Go Read a Book" replies...
However, I do appreciate your willingness to aid. This is why I'm sharing my findings with you...
-Kay
|
|
|
|
|
The root of your design problem is that you have declared a Patient class that holds an array of what would be properly conceived as individual patient instances. Your code has a severe readability issue and violates object-oriented design principles. If you're going to use that class to hold 5 static people, then a class called PatientList would indicate your intent more clearly. Save the obfuscation for later.
An approach that would be more reasonable from an OOD standpoint would be to create a class called Patient that encapsulates each individual patient's ID, first, middle, and last names, and then use the PatientList class to maintain an array of Patient objects.
Also, your use of static is highly questionable. Unless your goal is to ensure that there is only one list of patients--ever--then there's no reason not to use member fields and instantiate a single patient list.
Finally... yes, read books. I don't think the CP community is necessarily trying to insult or demean when making this suggestion. There's no reason to get started off in programming on the wrong foot. It's apparently obvious from the nature of the original question that you don't have a solid grasp on C#'s object fundamentals and object-oriented design.
These basics are going to be necessary if you ever plan on moving past "Hello, World!" and becoming a leader. Leaders are successful and secure. Followers are a dime a dozen and can easily be replaced by someone willing to do the work for half the price.
--
I've killed again, haven't I?
|
|
|
|
|
I have no problem being told to read books... but if that's all you put in the post. Then it has an insulting demeanor. If it's accompanied by help...it feels different. That's just my opinion...
As for your comments. I agree.... the Patient Class would've been better named as PatientList.
You go on to say create a class to maintain another class's array Information.
If I'm not mistaken the Code would looks something like PatientList.Patient.id[0]
Either way, I thought you might find this funny.....sometimes "Hello World" isn't such a bad thing. Sometimes it makes the most sense....
-Kay
|
|
|
|
|
If you use PatientList with an array of Patient objects, accessing the first patient's ID would be more along the lines of PatientList.Patients[0].id .
It would also be more readable and nimble when doing multiple things to a single patient:
Patient p0 = PatientList.Patients[0];<br />
p0.id = "blah";<br />
p0.middleName = "Blahblah";<br />
...
--
I've killed again, haven't I?
|
|
|
|