|
Hello experts...
I am developing a desktop application. In that I use some web services that will fetch the data from web. As we all know the data comes from web service in the XML format and So first I parse it and then save into the msaccess databse.
When I click on button1. The web service is called and it will connect to the server and download the data in XML format and then after parsing I save it into the DB.
As obious it will take some time. It may be depends upon the net speed aur amount of data etc. Now mean while the end user thinks the application is halted. So I want to create an progress bar that will shows the current status like
Opening connections
Connection to web site
parsing the XML
saving the data
closing connections
etc.
How can I do that...? I also try threading but unable to get proper result because I have to check what is going on the code (taking data from web,parsing or saving data into the db)
Please help me
Regards
Pankaj Joshi
|
|
|
|
|
You can do your webservice calls in a backgroundworker, and then it can call the main thread with progress info. Of course, you can't provide a progress bar during an single step, such as a web service call.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillionOneHundredAndFortySevenMillionFourHundredAndEightyThreeThousandSixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it )
|
|
|
|
|
If the Application is havy background operation, use BackgroundWorker
You can also use
private void SetProgressBar(int value)
{
this.progressBar1.Value = value;
Application.DoEvents();
}
When one event is end, just change the value of progress and lable message status.
means,
lblmessg.text="connecting........"
SetPogressBar(10)
SQL_Connection()
lblmessg.text="Connecting to web sites"
SetPogressBar(30)
Connect_WebSites()
......
Similary............... You can do....
But Backgorund Worker will be better
|
|
|
|
|
hi friends
i wanna store a image in ms access database and the code is
Aurigma.GraphicsMill.Bitmap bitmap =
new Aurigma.GraphicsMill.Bitmap(@"c:\mountain.jpg");
//Resize bitmap
bitmap.Transforms.Resize(bitmap.Width / 2, 0);
System.Data.OleDb.OleDbConnection connection =
new System.Data.OleDb.OleDbConnection(connectionString);
System.Data.OleDb.OleDbCommand command =
new System.Data.OleDb.OleDbCommand("INSERT INTO [Image](Image_Data) " +
"VALUES (?)", connection);
System.IO.MemoryStream stream = new System.IO.MemoryStream();
bitmap.Save(stream, new Aurigma.GraphicsMill.Codecs.JpegEncoderOptions(70, false));
byte[] imageData = stream.GetBuffer();
System.Data.OleDb.OleDbParameter parameter = new System.Data.OleDb.OleDbParameter(
"@Image_Data", System.Data.OleDb.OleDbType.LongVarBinary, imageData.Length);
parameter.Value = imageData;
command.Parameters.Add(parameter);
connection.Open();
command.ExecuteNonQuery();
connection.Close();
I am dynamically setting the background image of the label by using a property grid so is there anyway to get the address of the picture please let me know that
regards
sindhu tiwari
its me sid
|
|
|
|
|
Hello Experts,
I developed a desktop application using C#.net 2005.
I also have a digital certificate and I want to attach it with my assembly I.e. abc.exe.
In .net IDE at signing tab
1. I check the Sign the ClickOnce manifests
and in that I also select the appropriate certificate.
2. I also enter the right time stamp URL
and
3. I also sign the assembly with storng name using a .pfx File
When I build the application it builds successfully.
But when I right click the abc.exe file and see the properties of it,
It does not cointains any certificate..
Where I creating the problem please help....
Regards
Pankaj Joshi
|
|
|
|
|
Hello Experts,
I'm developing an desktop application in VS.net 2005. I make installer of it using Setup and deployment project in .Net.
In that I add Application launch shortcut, HTML help file launch Shortcut and uninstall shortcut.
Now I want to add one more shortcut that will open my home page...
How can I do that...?
Regards
Pankaj Joshi
|
|
|
|
|
pankaj.indore wrote: Now I want to add one more shortcut that will open my home page...
Create a internet shortcut file which navigates to your home page and add this to start menu
|
|
|
|
|
Thx for your reply,
For that I have to creat an new exe that will navigates to home page.
I don't want to create any more exe's.
Is their any method to directly navigate the page...?
Regards
Pankaj Joshi
|
|
|
|
|
I am not talking about exe. A single file, internet url shortcut, clicking on the file will open up the specified website
|
|
|
|
|
Hello sir,
It's working thx a lot.
Regards
Pankaj Joshi
|
|
|
|
|
Hi Pankaj
Please check my post !!!!
|
|
|
|
|
Hi Pankaj,
Use This one, I have done the same thing few times ago.. now it will help you.
Call Function
urlShortcutToDesktop("My Home Page ", myurl);
Function Defination
private void urlShortcutToDesktop(string linkName, string linkUrl)
{
string deskDir = Environment.GetFolderPathEnvironment.SpecialFolder.DesktopDirectory);
using (StreamWriter writer = new StreamWriter(deskDir + "\\" + linkName + ".url"))
{
writer.WriteLine("[InternetShortcut]");
writer.WriteLine("URL=" + linkUrl);
writer.WriteLine("IconIndex=0");
FileStream fs = new FileStream("C:\\Internet.ico", FileMode.Create);
Resource1.Internet.Save(fs);
fs.Close();
string icon = "C:\\Internet.ico";
writer.WriteLine("IconFile=" + icon);
writer.Flush();
}
}
internet.ico store in a Resource file, as Internet. AS i used Resource1.Internet.Save(fs); U can use this icon in ur own way also
Let me know when done.
|
|
|
|
|
Thx for your reply sir,
But I am querious where to write this code and how it works...?
I am asking to ad an web page short cut with my application like
Start>Programs>ABC Corp>
1. Application
2. Help file
3. Uninstall application
4. Home page
Please reply
Regards
Pankaj Joshi
|
|
|
|
|
ok, then create a simple internet shorcut file with your home page id and store it into Program menu path [ While Creating Setup ]
In Setup project.....
There is s Sesction "User's Program Menu" where you can put this link also with all others stuff.
Good luck !!!!
|
|
|
|
|
Abhijit Jana wrote: private void urlShortcutToDesktop(string linkName, string linkUrl)
{
string deskDir = Environment.GetFolderPathEnvironment.SpecialFolder.DesktopDirectory);
using (StreamWriter writer = new StreamWriter(deskDir + "\\" + linkName + ".url"))
{
writer.WriteLine("[InternetShortcut]");
writer.WriteLine("URL=" + linkUrl);
writer.WriteLine("IconIndex=0");
FileStream fs = new FileStream("C:\\Internet.ico", FileMode.Create);
Resource1.Internet.Save(fs);
fs.Close();
string icon = "C:\\Internet.ico";
writer.WriteLine("IconFile=" + icon);
writer.Flush();
}
}
WHY all these when we have an easy option for creating internet shortcut
|
|
|
|
|
can you please inform me how we can create shortcut?
Thanks in advance.
|
|
|
|
|
Because i have a problem when view in IE and Firefox. The result view in firefox don't give me what i need like i view in IE.By some experiment,i think it's about and .
Do firefox have a problem with <iframe> ?
Can i remove <!DOCTYPE> tag ?
another question..
Can i use javascript(outside tag <html>) to decide whic DOCTYPE version to use?
Thank =)
-- modified at 23:08 Tuesday 23rd October, 2007
|
|
|
|
|
bug_aonz wrote: Do firefox have a problem with <iframe> ?
No it don't have any problem with firefox. Only thing is you need to make sure whatever you have written is up to w3c standards.
bug_aonz wrote: Can i remove tag ?
You can remove Doctype. It will correct the display problem. Previously browsers used to ignore this tag and render whatever it understood from the HTML elements. But now the scenario got changed, and page will be rendered depending on the Doctype, I mean changing doctype can change the design. But removing won't make any problem.
|
|
|
|
|
bug_aonz wrote: The result view in firefox don't give me what i need like i view in IE.
With almost complete certainty, the page is rendered correctly in Firefox and incorrectly in IE. You have built your page to rely on rendering bugs in IE, which makes it look different in all other browsers that doesn't have the same bugs.
bug_aonz wrote: Do firefox have a problem with ? </blockquote>
Not at all.
<blockquote class="FQ"><div class="FQA">bug_aonz wrote:</div>Can i remove <!DOCTYPE> tag ?</blockquote>
Removing the doctype make the browser display the page in quirks mode. For Firefox this doesn't cause much problems, but in IE it makes a huge difference, as it makes the browser work more or less like IE version 4.0, complete with the box model error and everything.
<blockquote class="FQ"><div class="FQA">bug_aonz wrote:</div>Can i use javascript(outside tag <html>) to decide whic DOCTYPE version to use?</blockquote>
No. The doctype tag has to be the first thing in the page, otherwise it's ignored, and the browser is thrown into quirks mode.
<div class="ForumSig"><small><small>---
"Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things."
-- Douglas Adams</small></small></div>
|
|
|
|
|
I create an XML document using the following:
XmlDocument doc = new XmlDocument();
doc.LoadXml(WeatherProxy.NDFDgen(dlatitude, dlongitude, gov.weather.www.productType.timeseries, System.DateTime.Now, System.DateTime.Now.AddDays(7) ,WeatherParameters));
doc.Save("../../forecast.xml");
Everything works great and the data requests are very flexible. WeatherParameters contains about 20 different bools for parameters.
The xml file is loaded with DATA!
Anyway, the nodes for the specific data like daily high temp for example are matched with time-span key-layout nodes. I need to match these keys that tell the datetime with the proper parameters. The data can contain many variable keys and parameters.
I need some ideas for grouping and manipulating this data so I can write a class, struct, array... whatever to organize it. Here's a snippet of the xml doc.
<time-layout time-coordinate="local" summarization="none">
<layout-key>k-p3h-n19-12
<start-valid-time>2007-10-22T14:00:00-04:00
<start-valid-time>2007-10-22T17:00:00-04:00
<start-valid-time>2007-10-22T20:00:00-04:00
<start-valid-time>2007-10-22T23:00:00-04:00
<start-valid-time>2007-10-23T02:00:00-04:00
<start-valid-time>2007-10-23T05:00:00-04:00
<start-valid-time>2007-10-23T08:00:00-04:00
<start-valid-time>2007-10-23T11:00:00-04:00
<start-valid-time>2007-10-23T14:00:00-04:00
<start-valid-time>2007-10-23T17:00:00-04:00
<start-valid-time>2007-10-23T20:00:00-04:00
<start-valid-time>2007-10-23T23:00:00-04:00
<start-valid-time>2007-10-24T02:00:00-04:00
<start-valid-time>2007-10-24T05:00:00-04:00
<start-valid-time>2007-10-24T08:00:00-04:00
<start-valid-time>2007-10-24T11:00:00-04:00
<start-valid-time>2007-10-24T14:00:00-04:00
<start-valid-time>2007-10-24T17:00:00-04:00
<start-valid-time>2007-10-24T20:00:00-04:00
<time-layout time-coordinate="local" summarization="none">
<layout-key>k-p12h-n9-13
<start-valid-time>2007-10-22T20:00:00-04:00
<start-valid-time>2007-10-23T08:00:00-04:00
<start-valid-time>2007-10-23T20:00:00-04:00
<start-valid-time>2007-10-24T08:00:00-04:00
<start-valid-time>2007-10-24T20:00:00-04:00
<start-valid-time>2007-10-25T08:00:00-04:00
<start-valid-time>2007-10-25T20:00:00-04:00
<start-valid-time>2007-10-26T08:00:00-04:00
<start-valid-time>2007-10-26T20:00:00-04:00
<parameters applicable-location="point1">
<temperature type="maximum" units="Fahrenheit" time-layout="k-p24h-n7-1">
<name>Daily Maximum Temperature
<value>81
<value>83
<value>70
<value>77
<value>77
<value>78
<value>76
<temperature type="minimum" units="Fahrenheit" time-layout="k-p24h-n6-2">
<name>Daily Minimum Temperature
<value>68
<value>60
<value>58
<value>59
<value>57
<value>56
layout-key and time-layout must be matched. I hope someone has dealt with something similar and can help.
Thanks
Ken
|
|
|
|
|
Ummm... what? Are there XML tags that aren't showing up? Should you have clicked "Ignore HTML tags in this message (good for code snippets)" ?
|
|
|
|
|
Yeah I checked the little box and still it wont show the tags...
I try it here again maybe this will work
<time-layout time-coordinate="local" summarization="none">
<layout-key>k-p3h-n19-12</layout-key>
<start-valid-time>2007-10-22T14:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-22T17:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-22T20:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-22T23:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-23T02:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-23T05:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-23T08:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-23T11:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-23T14:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-23T17:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-23T20:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-23T23:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-24T02:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-24T05:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-24T08:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-24T11:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-24T14:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-24T17:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-24T20:00:00-04:00</start-valid-time>
</time-layout>
<time-layout time-coordinate="local" summarization="none">
<layout-key>k-p12h-n9-13</layout-key>
<start-valid-time>2007-10-22T20:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-23T08:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-23T20:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-24T08:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-24T20:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-25T08:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-25T20:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-26T08:00:00-04:00</start-valid-time>
<start-valid-time>2007-10-26T20:00:00-04:00</start-valid-time>
</time-layout>
<parameters applicable-location="point1">
<temperature type="maximum" units="Fahrenheit" time-layout="k-p24h-n7-1">
<name>Daily Maximum Temperature</name>
<value>81</value>
<value>83</value>
<value>70</value>
<value>77</value>
<value>77</value>
<value>78</value>
<value>76</value>
</temperature>
<temperature type="minimum" units="Fahrenheit" time-layout="k-p24h-n6-2">
<name>Daily Minimum Temperature</name>
<value>68</value>
<value>60</value>
<value>58</value>
<value>59</value>
<value>57</value>
<value>56</value>
</temperature>
I love programming!
|
|
|
|
|
Well that looks better. But I don't see how the elements relate. Looks like there's plenty of documentation on their site though.
|
|
|
|
|
The elements relate through the layout keys. You match each data element within a node to the corresponding key-layout. I already figured out how to match these suckers. I am having trouble coming up with a plan to load the data so that I can sort each data item with the time frame it matches. I came up with some ideas last night but when I change something in the request like the number of days or something it throws everything off.
I thought about a class where the code holds for one day...but some of the time spans are like 8:00am to 2:00pm and others are from 6:00am to 8:00pm and such. Those suckers dont match.
I'll eventually figure out a scheme to load this data and sort it usefully. Ive just been stuck on this for a day or so and that doesnt usually happen any more. Maybe I'm getting too old for this stuff. lol
Thanks for your help.
I love programming!
|
|
|
|
|
Hello people!
Im making a little game with SDL.NET. And because I want to spread my game, I ship all the dll's, now my folder is filled with dll's, and it is not looking neat. Is there a way to combine them ( resource for example ) and use them ? Or put them in a folder called "depencies" for example ?
All .NET dll's can I combine with Netz, so that is not a problem, the unmanged dlls are .
Good night!
|
|
|
|