|
Hello,
VS 2005
I have created a Pocket that uses a web service to get data from a SQL server.
I have created the web refererence to the web service.
I am developing a pocket PC in WM 5.0
However, when I click a button on the PDA to get the data I get this error message "Cannot establish a connection to the network"
I am using active syn and have and using the emulator. This has been connected ok.
I have also configured the emulator from File | configure | Network and checked host only network. ( I don't think this makes much difference as the pocket 2003 i developed, it did not make much difference, as it worked if it was checked or not).
The code that causes the error is below:
<br />
Try<br />
Dim ws As New DataIncidents.Service()<br />
Dim ds As New DataSet<br />
<br />
ds = ws.getIncidents()<br />
'Dim cnnStr As String<br />
'cnnStr = ws.getIncidents()<br />
<br />
Me.grdIncidents.DataSource = ds.Tables(0).DefaultView<br />
<br />
Catch ex As Exception<br />
MessageBox.Show(ex.Message)<br />
End Try<br />
If I add the Url line in, it works ok
<br />
Try<br />
Dim ws As New CodeRed.Service()<br />
ws.Url = "http://1.1.1.1/Incidents/Service.asmx" 'Works with this line<br />
Dim ds As New DataSet<br />
<br />
ds = ws.getIncidents()<br />
'Dim cnnStr As String<br />
'cnnStr = ws.getIncidents()<br />
<br />
Me.grdIncidents.DataSource = ds.Tables(0).DefaultView<br />
<br />
Catch ex As Exception<br />
MessageBox.Show(ex.Message)<br />
End Try<br />
Its not good to have this line hard coded in the program as if the location is changed then the problem will no longer function.
Can anyone tell me why I am getting this error.
Many thanks in advance,
Steve
|
|
|
|
|
Maybe when you added the WebReference to your project you used http://localhost/ws/Service.asmx in the url, you should use the ip address of the pc since localhost when executed in the PPC will be the PPC itself
I hope this can help you, but even if it works, since you dont want to hard code the url, this wont be the best way to do it
Maybe you should write the url in a text file and read the url from that file when you execute the project to establish the ws.url property dinamically
Alexei Rodriguez
|
|
|
|
|
Thanks Alexei,
I did something stupid, I forgot to change the web reference properties to my computer IP address.
Steve
|
|
|
|
|
Hi Steve,
I think u r getting this msg becoz u have not cradle ur device . In WM 5.0 u have to cradle ur device to make data connection from Desktop PC or laptop.
Ankur
|
|
|
|
|
Hi.
I'm writing an application with Compact Framework 2.0 SP 1. I want to apply the [STAThread] attribute to the main method, but there seems to be no such attribute. I get offered the MTAThread attribute, but not STAThread. Of course, the compiler doesn't find either. It just seems to be missing in the referenced assemblies (System.dll). I didn't find anything about this problem on the web, so could anybody help me, please? I'm quite desperate. I already reinstalled the CF 2.0, no success. Nobody else seems to have had this problem, ever. Help!!!
Thanks!
rudiman
PS: Sorry for posting this question in the .NET discussion group, too. Now I think it fits better here.
-- modified at 18:58 Saturday 2nd December, 2006
|
|
|
|
|
STAThread is relevant to COM. There are two versions of the COM runtime available to the OEM for Windows CE. One only supports in-process COM objects, with no marshalling: the objects must support the free-threaded model. The other version is a reasonably full DCOM implementation which supports full cross-apartment and cross-process marshalling (in some versions, also cross-machine connections but I think this was dropped in CE 5.0 and later).
Windows Mobile devices include only the simpler in-process, no-marshalling version. Compact Framework therefore doesn't support the more complete version. There's no point having the STAThread attribute because the underlying support isn't there.
|
|
|
|
|
Hi,
I have developed an audio record/playback app using Visual Studio 2005 on i-mate JAM (Windows Mobile 2003 OS). If I record and play back a large single buffer, I get good quality audio. However, if I fragment the buffer into smaller records and use the callback facility provided with waveInOpen(), I get bad quality audio and the audio takes longer to play. This seems to be due to the fact that the overhead in preparing/unpreparing and adding buffers is creating a burden on the system. I find this strange since the micro is a 400Mhz Arm device that has plenty of steam. I have tried using the event-based notification and the windows message notification, even polling the flag in the WAVEHDR structure. I am also using double-buffering.
Without including the actual code, I wondered if anyone else has experienced problems like this using the audio wave function on a Pocket PC ?
|
|
|
|
|
I'm a rookie, and I am learning to write mobile programs using c++ these days.
Yesterday I write a listview, it has the fouction of insert new, modify, and delete items, and when click on the label on the top, items will sort by the column you click.
The problem is, the first item I've inserted into the list refused to attend the arrangement, it is always on the first line. So I hope you guys give me some prompts, thanks.
|
|
|
|
|
Hello,
VS 2005 SQL Server 2005
I have a pocket PC application and have a web service. The pocket PC will connect to the web service and the web service will get the information from the database. This works fine when using the emulator and running from the local host.
Later I will have to deploy the web service and install the solftware on the Pocket PC.
My question is once that has been done, how will the Pocket PC talk to the web service on the internet so that people using the PDA can download there data?
Is it a question of using connecting PDA to the internet and the web reference URL will connect to the web service.
Getting the data from the database is not a problem, only the Pocket PC to the web service.
Many thanks in advance,
Steve
|
|
|
|
|
What do you mean by it works fine in the emulator?
If it works through the emulator, theoretically it will work on the device.
What are you doing to get it to work in the emulator?
Basically you set up the WebService reference in your CF project, and create a WebService object with that url, and work through the exposed web methods.
What's in a sig?
This statement is false.
Build a bridge and get over it. ~ Chris Maunder
|
|
|
|
|
Dear Friends,
Seeking support from porfessionals!
How to write application for Symbol Mobile computer MC1000 using VS.net 2005?. This device works on Win CE and also has an in-built barcode scanner.
What will be the minimum set of tools?
Will it be possibel with VS.net 2005 alone? How to port the application to the device?
Please co-operate as little help is available for beginers
Thanks and regards,
always share to enhance your knowledge...!
|
|
|
|
|
You'll need to download the Symbol SDKs from their website. They have some sample applications to get you on your way. You might have to install the cab on the device if it doesn't come with it.
What's in a sig?
This statement is false.
Build a bridge and get over it. ~ Chris Maunder
|
|
|
|
|
Hi all, I am so hoping that someone can help me out here. I'm writing an application for a terminal[^]. I'm only starting to learn C# and with this terminal and all its sort of a double learning curve for me although I am experienced in C++.
I've had plenty problems which I've managed to iron out one after the other but it seems that I have now reached a dead end where I simply lack the know-how to troubleshoot. When I compile my application it gives no warnings or errors. I can run it on the PC but when I copy it across to the device I get various exceptions. And what really concerns me is that I can't readily reproduce these exceptions. The three exceptions that I mostly get are InvalidProgramException , TypeLoadException and MissingMethodException .
When I comment out lines of code from my application, and these can be real meaningless lines such as MessageBox.Show("1st image loaded"); I get another exception. As I said, these exceptions seem not to be predictable and I never know which one I'm going to get - a bit like a box of chocolate (sorry, bad joke ).
Anyway, I would be very appreciative if someone could give me some advice as to how to get to the bottom of this.
Some background that might be of use:
The device runs Windows CE 4.2 and .NET CF 1.0
I'm using Visual Studio 2005
When creating the project I've selected Visual C# -> Smart Device -> Pocket PC 2003 -> Device Application (1.0)
This is because there is no option for Windows CE 4.2 (only 5.0) and I need to target the CF 1.0
When I create just a basic application with a form and some buttons etc. it does work on my device.
|
|
|
|
|
Hi Dewald,
I think this is because the .net framework in vs2005 you r using is 2.0. Can you try this.
File->New Project->Visual C#->Smart devices->Smart Phone2003->Device Application.
I know you want pocket pc 2003, we can do to it .This is to make sure that vs2005 will take .net framework 1.0.
From Project menu select "Change Target Platform" and select pocket pc 2003 and accept the changes.This will change the target platform to pocket pc but the .net framework will remain the same (ie 1.0). Now u try ur code . If the problem is what i think it will work, other wise sorry man.
Sujith
|
|
|
|
|
Dewald wrote: I can run it on the PC but when I copy it across to the device I get various exceptions
what do you mean by this? running in emulator. How r you copying files to the device? vs2005 can automatically deploy the solution and all the required dlls to the device, and later you can develop a cab project of the solution and then install it on the device if needed.
you can run the program with out manually copying.Check if you are following these steps.
1.From Tools menu select "Connect to Device",select "Pocket pc 2003 device" and press connect buttom. If connection succeeds, ok.
2.Build or Rebuld the solution
3.Then run the project, ensure you have selected "Pocket pc 2003 device" in the combo box for target device.
It may take some time for the first time but after that you can run the project again with less time.By doing this vs2005 will deploy the solution to the device and all the supporting files.
regards
Sujith
|
|
|
|
|
I am trying to port an ap I wrote for stardard window to Windows Mobile 2003.
I am trying to find some code that will allow me to Ping IP address and Issue Wake on Lan commands.
Does anybody have or now of code I could use. I have tried several bits of standard windowswith no luck.
Thanks in advance
|
|
|
|
|
Hi,
I'm trying to read the content of a file which I've put in bin\debug.
So I define StreamReader sr=new StreamReader("file.csv"); but I get this error "Could not find file '\file.csv'".Do you know what the problem is?Why is adding a backslash?
Thanks
P.S. I've put the same question in web development by mistake because I'm trying to do a mobile app
|
|
|
|
|
As far as I know WinCE has no concept of a working folder, so all paths are absolute.
This means "file.csv" is the same as saying "\file.csv". You need to set the full path, ex: "yourlocation\bin\debug\file.csv".
|
|
|
|
|
You could easily use My.Computer.FileSystem.CurrentDirectory & "\file.csv" or however you call the "Current Directory" in C#/C++.
|
|
|
|
|
I am Faced Similar Problem and Finally Got Answer i am sharing it with you. following is portion from my iMate SP3 phone C# Program.
------------------------
using System.Reflection;
.....
Assembly thisExe = Assembly.GetExecutingAssembly();
string appPath = thisExe.GetModules()[0].FullyQualifiedName;
string appDir = Path.GetDirectoryName(appPath);
StreamReader sr=new StreamReader(appPath+"\\file.csv");
------------------------
ChandraKanth Injamuri (+919840986683)
|
|
|
|
|
Hello everyone,
I have used Visual Studio 2005 to create a C# .Net Compact Framework 1.0 application on Pocket Pc 2003 device. But when building the application, there are some errors dealing with System.Data can not find.
I have solved this issue by manually add System.Data from References of project, and it is working now. I am wondering whether we should manually add reference to System.Data in an application based on .Net Compact Framework 1.0 (Pocket PC 2003).
thanks in advance,
George
|
|
|
|
|
Hi, i'm very newbie about mobile web application. So i have some problems about deloying a mobile web application in reallife.
I am using vb.net (2003) to make a mobile web application. And i use Nokia web browser 4.0, nokia mobile internet toolkit 4.1, nokia wap gateway 4.0 to deloy that application on local computer and it is running well.
But i don't know how to deloy it in reallife like :
+ Where should i put Nokia mobile internet toolkit on my phone ( client ) or on server?
+ What will i config? ( port, ip ... or something else ).
And one more thing, when i want to move from pageA.aspx to pageB.aspx, i use RedirectToMobilePage("pageB.aspx"). But before moving to pageB.aspx, it ask me to confirm moving. How could i do to turn off that confirmation?
Please give me some advice. Any ideas will be welcomed.
|
|
|
|
|
Hello, where can I found an example to communicate with a database in windows mobile (in native c++ and simple sql strings)
I found on the net that I must use OLEDB with SQL Server Mobile
In java it's very simple to do that
thx
|
|
|
|
|
hi everybody,
got a problem on developing with vstudio2003 for my mobile device which is an anubis typhoon 4500sd.
i wrote a small and simple helloworld application with one button on a form that shows a simple messagebox. Everything works fine under the pocketPC 2003- emulator.
but when i build a cab- file (target- device: ARMV4) ,copy it to my SD- Card and install this on my device, the application doesn't start. the installation- procedure seems to work well, no error- messages, but when it's finished and i click the installed icon, nothing happens.
the manual says that the compact- framework is already installed on this device (in ROM), but even when i try to install it again by copying and installing the necessary files to the device (netcf.all.wce4.armv4.cab) the behavior of the helloworld-app won't change. so, the situation today is that none of the vstudio2003- apps that i have build and deployed as cab-file to my device, works.
i have no idea of what might be wrong, perhaps anyone of you ?
with kind regards
heb
|
|
|
|
|
I have a form that initially did not have a sip or menu.
Form works fine but needed to add sip for easier editing of user fields.
When sip/menu added, the paint event only fires on the first entry into the form and not subsequent entries.
Paint event would always fire on all loads of the form before menu/sip added.
No additional code added outside of what was added by the designer when sip/menu added.
I've tried refresh and invaliding different components on the form the paint event does not get to the form.
Any suggestions would be greatly appreciated.
|
|
|
|