|
I'm having problems adding 2 web references to my project.
1) When I go to add the web reference, it shows that there is a service, and it has the method querey(). However, when I add it, I do not see this method any where in the c# file. This problem also occurs when I download the wsdl for the webservice and run wsdl.exe.
2) Another web reference, when I try to add it, I can go to it, and see the documentation and methods for it. However, in the "Web services found at this URL:" box it says "The proxy settings on this computer are not configured correctly for web discovery. Click the Help button for more information." and won't let me add the web reference. I've clicked the help button, but haven't seen anything that tells me what I need to do about the proxy settings.
Does anyone have any idea on either why the method disappears in #1, or what proxy settings need to be for web discovery?
Thanks for your help.
|
|
|
|
|
Hi,
I am a beginner to C#.How do I create a library file in C#? And how do I invoke it im my program?
Karteek
|
|
|
|
|
This is a fundamental and broad question Karteek. You really need to pick up book or do some C# tutorials to understand the basic concepts.
To get you on the right track you need to learn about classes and instances. In C# a class is normally stored in a .CS file.
regards,
Paul Watson
Bluegrass
South Africa
Chris Maunder wrote:
"I'd rather cover myself in honey and lie on an ant's nest than commit myself to it publicly."
Jon Sagara replied:
"I think we've all been in that situation before."
Crikey! ain't life grand?
|
|
|
|
|
I have a unsolved query in my mind. Suppose i have n-number of product which are identified by colors and stored in some table.
ColorName$ProductName( here the ColorName is hexadecimal value)
eg: #ff453787$Shirt
Like this i have lot of data in a table called Colortab.
I want to bind this data to a datagrid. Here datagrid have to show the color and the name.
that is it will convert the hexadecimal to Color + $ + ProductName
Is this possible to show in datagrid?
Sreejith S S Nair
|
|
|
|
|
Is its windows forms or asp.net datagrid ?
There are various ways you could do it, can we see what you've got and then take it from there ?
Try not! Do or do not, there is no try. - Master Yoda
|
|
|
|
|
Convert the 32-bit integer (like ff453787) to an int , then call Color.FromArgb(int) to get the color. You can then use Color.ToString . Note that for colors not defined in the KnownColor enumeration, a hex value like you already have will be output:
try
{
int argb = int.Parse("#ff453787$Shirt".Substring(1, 8));
Console.WriteLine(Color.FromArgb(argb));
}
catch
{
} If you want to match these up with colors in your "Colortab" table, then you'll need to perform a separate look-up. I would suggest constructing your SQL query to return these as separate columns to make it easier to bind. You could also in that case use a JOIN or UNION to use the names in "Colortab" instead of the hex values. You can always re-concatenate these on the server or in your client code if you want to.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
thanks
i got. let my try that.
Sreejith S S Nair
|
|
|
|
|
i tried your answer. but i can't see the color and no error. Only i can view the value 0 on the place of color.
Sreejith S S Nair
|
|
|
|
|
I am trying to retrieve a property from the current executing assembly using the following but am getting a TargetException
int MyInt = Convert.ToInt32(Type.GetType(Page.GetType().BaseType.FullName).GetProperty("MyIntProperty").GetValue(null,null));
Anybody know what I'm doing wrong?
Thanks
monkey say, monkey doo
Uncle Monkey
|
|
|
|
|
Wow! You really should split your lines up into distinct pieces - it greatly helps during debugging your application.
You're doing a few things that aren't necessary and would hamper performance, like Type.GetType(Page.GetType().BaseType.FullName) . Instead, you already have your Type using just Page.GetType().BaseType .
Also, when you call GetValue you must pass the instance of the object (presumably Page ) otherwise you would get an exception since you're trying to retrieve the value of a null reference.
Also, if you flatten your instance members, you really don't need to refer to the base Type to get the property where it's declared. Unless BindingFlags.DeclaredOnly is specified, all instance properties - both declared and inheritted - are reflected (not so with statics, unless you specify BindingFlags.FlattenHierarchy ). In ASP.NET, which I assume you're using since you have a Page object - though this could be anything - there is actually a large hierarchy of pages that extend from the Page class, such as your .aspx file : your code-behind page class : Page .
Type t = Page.GetType();
PropertyInfo prop = t.GetProperty("MyIntProperty", BindingFlags.Instance |
BindingFlags.Public | BindingFlags.NonPublic);
int MyInt;
if (prop != null) MyInt = (int)prop.GetValue(Page, null);
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks, worked a treat
monkey say, monkey doo
Uncle Monkey
|
|
|
|
|
Hi there,
I have one question regarding adding code comments (summary, etc.) to namespaces and assemblies.
If I generate the comment web page I get some html pages which contains my comments for classes and members, but not for namespaces and assemblies.
In java (or at least in Eclipse) there is a choice to have package.html documents to be included as document comment for packages (namespaces). Is there any such feature in .Net, C# or Visual Studio .Net (2003)?
If not, are there other tools to create proper reference manuals from code comments in C#.
Thank you!
Michael
|
|
|
|
|
There is no standard tags for commenting a namespace. If you use NDoc[^], we did add the capability to do so however, and it's discussed in the product documentation. NDoc is a very power, extensible, and FREE API documentation generator for .NET and can generate many types of documentation formats, like HTML Help 1, Help 2 (for VS.NET), and several others. You can always add your own documenters as well.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks, for your quick answer. I will take a look into NDoc, this should indeed solve my problems.
Thanks again!
Michael
|
|
|
|
|
i'm a newbie in C#. I have a datagrid and I want that when I doubleclick a row to load a new form with textboxes in which I'll have the data from that specific row. how can I pass the data between the datagrid and the new form textboxes?
Thx in advance and I hope I was clear in my request, because my english really sucks )
|
|
|
|
|
hi,
follow the steps below...
a) Write a class that can hold the inputed data(values from textboxes)
b) Make an object of this class in your calling form
c) handle the double click event of the datagrid.
d) In the delegate instantiate the data entry form and open it as modal dialog
e) while instantiating data entry form pass the object of the data class through the contructor(you need to modify the constructor of the data entry form to accept an object of type : data class)
f) Give the "ok" or "close" button in the data entry form a dialog result... say "OK"
g) On click event of ok button populate the data class with the values.
h) in the calling form check for the dialog result right after you call "ShowDialog()" in the data entry form
i) if the dialog result is OK then populate the datagrid with the values in the class object
rest is upto your guess work... and how u can enhance this...
regards,
Aryadip.
Cheers !! and have a Funky day !!
|
|
|
|
|
|
//Note : before running this code please show some data on datagrid.
//write your code on doubleclick event of your data grid.
//this code is not full. here you will get
//an idea and remaining you have to develop based on your requirement.
//If this is not self explanatory then please let me know that.
//here you will get the point that where you clicked.
Point pt=dataGrid1.PointToClient(Cursor.Position);
//row or coloumn no where you clicked
DataGrid.HitTestInfo hit=dataGrid1.HitTest(pt);
//here i am checking whether i clicked on row header the show the form .use Hittesttype enum to achive your idea
if(hit.Type==DataGrid.HitTestType.RowHeader)
{
Form2 Frm=new Form2();
Frm.ShowDialog();
// you got the idea right.
//use the below line to get data from datagrid or set data to datagrid
dataGrid1[hit.Row,0]="haha";
}
Sreejith S S Nair
|
|
|
|
|
thx a lot, this was very helpful
|
|
|
|
|
hai there,
i have a form with two label control. i need to click on that control. how ? using mouse right. ha ha.
here i need to call the click event programatically without clicking on that control. I won't use any custom event handler here .
Is it possible to control the event triggering through programmatically
Sreejith S S Nair
|
|
|
|
|
Hi,
If you are trying to call the event delegate from any perticular place... say...
you want that when you click on the first label the second lebel controls click event should trigger...
if this is your plan... then you don't need to trigger an event actually... you call the delegate method directly with the necessary parameters... or incase you don't need the parameters send null.
regards,
Aryadip.
Cheers !! and have a Funky day !!
|
|
|
|
|
if you don't have clear picture of problem and solution please don't reply any queries.
Sreejith S S Nair
|
|
|
|
|
Hold it!
Since your a beginner at this, your problem descriptions will no doubt be vague at times or completely incomprehensible, especially since your English is also not too good. I suggest you cut us some slack...If we can't understand you, we're going to ask questions and make suggestions for further clarification. If you can't provide a clear description of the problem, it's not your place to jump down someone's throat, especially if they are trying to understand and help you...
...the soapbox is now available...
RageInTheMachine9532
|
|
|
|
|
If you're calling this from within a Control , you can call the undocumented protected member InvokeOnClick like so:
InvokeOnClick(label1, EventArgs.Empty); Otherwise, you'll have to P/Invoke SendMessage (see http://pinvoke.net/default.aspx/user32.SendMessage[^]) and send WM_LBUTTONDOWN (0x0201) and WM_LBUTTONUP (0x0202) in sequence using the Handle property of the control for which you want to simulate a click as the first parameter to SendMessage .
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks for your this mail and your nice suggection. In future also i am expecting the same if i make any mistake.
The main problem is now i have little pressure in my office. So i won't get time to tryout the queries. What normally i will do is, will give little idea that known to me. And if it is wrong i will surly appologies that.
I get into dotnet through book and online material only. So this may happen.
I will try my level beat to avoid this sort of problems.
Sreejith S S Nair
|
|
|
|