|
HI chris,
i found the answer, thanks, it was useful.
well, i have been looking for some sample, that just does this: (a COM Wrapper)
1. A VB.NET COM Class that connects to the remote webservice,
2. Fetches the data from the WS, by passing a parameter to it,
3. Populate the values into the property of the COM Class
By doing so, I can consume the webservice form within a ASP or Vb6(un managed code) application.
Any ideas would be greatly appreciated. Thanks.
Baajhan
Sincerely,
Baajhan
|
|
|
|
|
I think it would be simpler to just create a proxy class and then compiling it as a .com object. I haven't tried it, but should also work.
Wsdl /language:vb /protocol:HttpPost /namespace:myNameSpace /out:yourfile.vb /username:username /password:password /domain:domain <url or="" path="">
look here: http://msdn2.microsoft.com/en-us/library/7h3ystb6.aspx
greetings chris
|
|
|
|
|
Hi guys,
I'm having a problem writing out a selialized dataset to a file.
I have a very big query that takes over an hour to run before it populates a dataset with data. I then process the data within the dataset.
It's not very time efficiend trying to debug the processing part of the code with this long delay so I'd like to dump the data to a binary file which I can load instead of running the query.
This is the code I'm using to try and save the dataset but I get an out of memory exception when I close the file stream.
Any help would REALLY be apreciated.
<br />
private void SaveDataToFile( string filePath )<br />
{<br />
try<br />
{<br />
this.m_dsModel.AcceptChanges();<br />
<br />
if( File.Exists(filePath) == true )<br />
{<br />
File.Delete( filePath );<br />
}<br />
<br />
FileStream fs = new FileStream( filePath, FileMode.Create, FileAccess.Write);<br />
<br />
BinaryFormatter formatter = new BinaryFormatter();<br />
try <br />
{<br />
formatter.Serialize( fs, this.m_dsModel );<br />
}<br />
catch (SerializationException e) <br />
{<br />
System.Diagnostics.Trace.WriteLine( e );<br />
}<br />
finally <br />
{<br />
fs.Flush();<br />
fs.Close();<br />
}<br />
}<br />
catch(Exception ex)<br />
{<br />
System.Diagnostics.Trace.WriteLine( e );<br />
}<br />
}<br />
<br />
|
|
|
|
|
You can get and set XML strings from a dataset.
Something like:
DataSet ds;
string xml = ds.GetXml();<br />
<br />
<br />
ds.ReadXml(xml);
hope this helps.
|
|
|
|
|
how to pick n distinct (no repetition) strings randomly from an array of strings without using a while loop.
Any help appreciated.
Jad J.
|
|
|
|
|
wli ma7dood walla ma fhemna shi 3alayk.
n2ebir kttob meshkeltak metl el khale2 khalena nse3dak.
hehehehhe
yalla bye
jamil abou khalil
|
|
|
|
|
You might want to try your own homework first, and ask specific questions if you get stuck.
|
|
|
|
|
this[^] might help you. Search on Random
|
|
|
|
|
Hi,
I placed Gridview in my form and created boundfileds and template field. I placed Imagebuttons, hyperlinks in templatefield. I set the DataKeyNames property. After the grid is populated with some data, i want to show some tooltips when cursor is placed on the respective imagebutton and want to perform some task(like moving to next page based on the selectedrow datakeyname).
I was able to show the tooltip on mousehover. The code i worte is
protected void Gridview1_RowDataBound(object sender, GridViewRowEventArgs e)<br />
{<br />
if (e.Row.RowType == DataControlRowType.DataRow)<br />
{ <br />
ImageButton c1 = (ImageButton)e.Row.Cells[0].FindControl ("ctnBtn");<br />
if(c1 != null) <br />
{<br />
c1.Attributes.Add("onmouseover", "");<br />
c1.Attributes.Add("onmouseout", "");<br />
}<br />
}<br />
}
But not able to get the datakeyname of that particlar selected row.
protected void Gridview1_RowCommand(object sender, GridViewCommandEventArgs e)<br />
{<br />
if (e.CommandName == "ctn")<br />
{<br />
string key = Gridview1.DataKeys[Convert.ToInt32(e.CommandArgument)].Value.ToString();<br />
string url = "qwer.aspx?key="+key.ToString(); <br />
Response.Redirect(url);<br />
....<br />
}<br />
}
I was able to get the e.commandname correctly and gettig into the loop but was not getting the
e.CommandArgument of the selected row. It is showing the null everytime.
I was able to implement this rowcommand function correctly when the imagebutton control is not in the template field.
Let me know how to implement the Findcontrol method for <asp:buttonfield> of GridView
Let me know where i went wrong in implementing the code.
Thanks in Advance.
|
|
|
|
|
I want to create an xml and put it to a string. I noticed that XmlWriter always adds an xml header and an encoding="..." attribute to this header. This encoding attribute becomes erroneous if I save the string as a file with some other encoding. Is there a better way to skip this encoding attribute than the one below?
StringBuilder builder = new StringBuilder();
XmlWriter writer = XmlWriter.Create(builder);
writer.WriteStartDocument();
writer.Flush();
builder.Replace(" encoding=\"utf-16\"", "");
writer.WriteStartElement("foo");
writer.WriteStartElement("bar");
writer.WriteEndElement();
writer.WriteEndElement();
writer.WriteEndDocument();
writer.Close();
return builder.ToString();
The result of this is:
<?xml version="1.0"?><foo><bar /></foo>
|
|
|
|
|
I found another, similar way, using XmlWriterSettings.OmitXmlDeclaration:
StringBuilder builder = new StringBuilder();
builder.Append("<?xml version=\"1.0\"?>");
XmlWriterSettings settings = new XmlWriterSettings();
settings.OmitXmlDeclaration = true;
using (XmlWriter writer = XmlWriter.Create(builder, settings))
{
writer.WriteStartElement("foo");
writer.WriteStartElement("bar");
writer.WriteEndElement();
writer.WriteEndElement();
}
return builder.ToString();
|
|
|
|
|
hai all,
in c# is there any way to count the number of occurence of a specific character in a string?
my string is a,b,c,d,e,f
i need to count the number of commas in this string
All I ever wanted is what others have....
CrazySanker
|
|
|
|
|
hi,
u can use this code:
<br />
String str = "a,b,c,d,e,f";<br />
String []count = str.Split(',');<br />
int numOfOccurance = count.Length - 1;<br />
hope it helps
Jamil abou khalil
|
|
|
|
|
string x = "a,b,c,d,e,f";
int y = x.Split(',').Length - 1;
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Or:
Regex regex = new Regex( "," );
int count = regex.Matches( input ).Count;
----------------------------
Be excellent to each other
|
|
|
|
|
Easiest:
int cnt = str.Length - str.Replace(",", "").Length;
Fastest and most resource efficient:
int cnt = 0;<br />
foreach (char c in str) {<br />
if (c == ',') cnt++;<br />
}
---
b { font-weight: normal; }
|
|
|
|
|
Hi,
I need to get some knowledge about the printing procedure in C# using VS 2005. I want to know how to use the print dialog and print document and any other necessarly object to print the text inside a text area (or multi-lined text box).
Thanks in advance;
jamil abou khalil
|
|
|
|
|
Hello
Did you revise the printing section in C# articles page?
Regards
|
|
|
|
|
hi,
I tried searching in the articles but i am not lucky to find anything.
If you can please point me to an article that may benefit me.
thanks
jamil abou khalil
|
|
|
|
|
I'm developing an Outlook Add-in with Visual Studio 2005 using COM.
I created a new project via Extensibility -> shared add-in, and I need to add the reference "Microsoft.Office.Interop.Outlook" in order to go on with the development. But it is no where to be found in the "Add Reference" Dialog Box.
Somebody help me, please......
|
|
|
|
|
I solved it myself...
The assembly is right there in:
COM -> Microsoft Outlook 11.0 Object Library......
|
|
|
|
|
I am creating a custom draw treeview with level 0 treenodes draw by the code below. I want to paint the entire node row, including behind the PlusMinus button with a color of choice.
The problem happens with my code running after the PlusMinus button is painted,thus erasing it. Is there some event fired before OnDrawNode painting the "+" that i am missing and should override?
Setting a breakpoint on the begining of OnDrawNode and seeing the control, shows me the "+" is already painted.
protected override void OnDrawNode(DrawTreeNodeEventArgs e){
if (e.Node.Level == 0){
Rectangle nodeRegion = new Rectangle(ClientRectangle.X, e.Node.Bounds.Y, ClientRectangle.Width, e.Node.Bounds.Height);
SolidBrush nodeBackColor = new SolidBrush(Color.BlanchedAlmond);
SolidBrush nodeForeColor = new SolidBrush(Color.Black);
Font nodeFont = (e.Node.NodeFont == null) ? this.Font : e.Node.NodeFont;
e.Graphics.FillRectangle(nodeBackColor, nodeRegion); // PROBLEM
e.Graphics.DrawString(e.Node.Text.Trim(), nodeFont, nodeForeColor, e.Node.Bounds.Location);
}
else{
e.DrawDefault = true;
}
base.OnDrawNode(e);
}
ps.: It looks like the OnPaint event isnt fired on a TreeView. Couldnt find why is this on MSDN.
Thanks!
Diego Valdevino
|
|
|
|
|
I have a UserControl and when Iam not using this.Region to form a custom shape for my UserControl everything is ok except that in the upper left and right corner you can see a cotrol background.
See here: http://img87.imageshack.us/my.php?image=goodjo2.jpg
When I put this piece of code:
region.Intersect(gp);
this.Region = region;
Where the gp looks like:
gp.AddArc(0, 0, 20, 20, 180, 90);
gp.AddArc(this.Width - 21, 0, 20, 20, 270, 90);
gp.AddLine(this.Width - 1, 20, this.Width - 1, this.Height - 1);
gp.AddLine(this.Width - 1, this.Height - 1, 0, this.Height - 1);
gp.CloseFigure();
In other words, those darker blue lines (borders) of the UC, I get this ugly looking corners in upper left and right corners and no right and bottom line.
See here: http://img291.imageshack.us/my.php?image=badid4.jpg
My question is, how can I set an Region to my UC without this 'stuff' around upper left and right corners and with right and bottom lines?
I hope you understand.
|
|
|
|
|
|
Hello,
I'm using Application.Exit(); in the form contructor to terminate the application if certain condition is met... but it's not working!
Why? and what can I do?
Thanks...
|
|
|
|