hellooo,
i am looking for a good tutorial to help me get started developing a simple application which will run on a Windows CE 4.1 device and will connect via Wifi to a local sql server and return/store data.
I am a bit lost since i dont even know where to start, i.e. i need visual studio .net alone or another SDK or someting?
any pointers to a suitable tutorial will be much apreciated.
Not too sure what you need for CE4.1 but this is a good place to start
MSDN Windows Mobile
and here's one way for your DB I think
http://msdn.microsoft.com/mobility/...ry/en-us/dnppcgen/html/intro_winmobile_vb.asp
Haven't looked at the code but you can use either
1)SqlDataAdapter and SqlCommandBuilder to get the results into a DataTable
or
2)SqlDataReader
thanks kev, msdn should have enought info to get me started.
saw that tutorial on msdn but it wont do, since it connects to the sql server via web services or someting, i want to connect directly to the server and execute sql queries.
if you use an oleDBdaptor or sqladaptor it will be transparent for the
system that you are a pda and not a normal pc
wifi is transparent too it's all LAN
Just checkout the classes I mentioned they give examples: SqlDataReader SqlDataAdapter
Related
I am wanting to develop a portal application in C# for Windows Mobile 6.0. I have installed the .net Compact Framework 3.5 on my device and have the necessary tools on the PC to develop for Windows Mobile. I am using Visual Studio 2005 to develop this application.
I am not a programmer, I have little experience with .net technologies but have for past assignments used VB.net to create small applications for assignments at uni.
I am now in my third and final year at uni and I decided to take on a project that is titled Human Computer Interaction of Mobile Devices. As part of my project I am required to produce an application, though designing various menu systems in itself will be quite a job, not to mention the documentation of it all.
The application I want to create now, is not necessarily part of my project, though it may influence me later on and should go some way to helping me. I have had the intentions of creating an application in Flash up to now.
Anyway, this application, its what I would call a portal. It has 4 tabs, Websites, Television, Radio and Programs. The Programs tab page has been designed much like the iPhone interface with either same or somewhat similar buttons. These buttons do not do anything at the moment.
I started the other week in designing an application in vb.net and run the debug exe as standalone on PC and linking to application that are on the PC will actually run when clicking on the picturebox as that is what I am using rather than buttons.
I put a Try Catch in and the error message comes up on the Mobile. If I take the Try Catch away then FileExceptionNotFound error message comes up and forces the program to close.
In C#, I have created much the same application, it does nothing whatsoever at the moment other than allowing me to flick from one tab to another. I am wanting to link pictureboxes in the programs tab to programs stored on the phone such as \Windows\Opera9.exe and \Windows\tmail.exe and so on.
I would like Radio Stations and Television channels to load up in a program specified in code if a default one does not start so I realise that I would need to call the link of the radio station (same with television channels) and then tell it to load up in specified program.
The other thing I am not sure about it how I would tell the phone to connect to the internet.
I didn't really want to be asking for help on here with this, as its probably not too difficult to create something like this, seeing as what some people (geniuses) on here have been able to develop. If nobody is able to help, then maybe pointing me in the right direction of some good reliable resources would be an idea. I have done much searching on Google etc for help with this and MSDN but my programming skills have never been up to much if I'm honest.
Any help would be much appreciated.
A few things then
For Visual Studio download and isntall the Windows Mobile SDK's (Version 6, standard and Pro).
Then when you create a new Mobile Device application you have everything you need. There should be a Toolbar in Visual Studio that allows you to select where your device will be run in Debug Mode (either the Emulator or on your device). This is the easiest way to debug your apps; also using MyMoblier will help.
Starting an App in C# is as easy as System.Diagnostics.Process.Start() method.
Connecting to the net is a little harder, I have written my own based on what I found using google. Basically it centers around 3 API calls:
Code:
[DllImport("CellCore.dll")]
static extern int ConnMgrEstablishConnectionSync(ConnMgrConnectionInfo connectionInfo, ref IntPtr connectionHandle, uint dwTimeout, ref ConnMgrStatus dwStatus);
[DllImport("CellCore.dll")]
static extern int ConnMgrMapURL(string url, ref Guid networkGuid, int passZero);
[DllImport("CellCore.dll")]
static extern int ConnMgrReleaseConnection(IntPtr connectionHandle, int cache);
Hope this helps
EDIT:
Also moved to Q&A to avoid upsetting them
Ta
Dave
Thanks for the advice. I have already downloaded Windows Mobile 6 SDK but I for some reason don't seem to be able to access the ROMS from WM6 inside of Visual Studio. I might be able work that issue out though. I will see how I get on with it and post back if I have any further problems.
Connecting to the internet.
I have found that the .net object WebRequest will open the connection if is not already open.
Stream ResponseStream = WebRequest.Create("yourURLgoesinhere").GetResponse().GetResponseStream() will return a stream to read to get the object.
If there is an active WiFi connection the phone will use it, or it will use an active GPRS connection, or fire up the default GPRS connection as a last resort.
The bottom line is - let the machine do all the hard work.
Hello everyone I was wondering if anyone could answer this question for me.
I am creating a wm app and for part of it i want some information from googlemaps, the maps api is in java and i was thinking of ways to incorperate this into my app. Can i create a java program to get data from google and have my c# program run the java program and get info from it? I could write my program totally in java but i don't like the way i have to first start the vm and launch my program from that is there a way to automate this? also I need quite a lot of information from the phone so using c# will make getting this info easier.
or are there any other ways i might be able to get the info I want, I don't really know anything about applets but could they somehow be used?
oh btw the specific data i want is distance between to map locations (via googles route not direct)
many thanks i hope comeone can help
Hi !
I have my own server at home, in order to have access to my files outside my home. This is very convenient.
I would like to have an online database (with forms like you can have with MS Access, but Online) so that I can organize my information (foreign language vocabulary, DVD list, todo list, ...). I can install it on my server, and I would like it to be easily accessible from my PocketPC (via Internet, or even better via an specific application on the PocketPC ).
Do you have some suggest for an existing application offering this ?
I have good knowledge (I have already worked with .NET at work).
Regards, Chris
This is very interesting to me. Are you familiar with SQL Server mobile?
I know SQL Server 2005/2008 good.
I have never really used SQL Server Mobile, but I have read about it. Why ?
Hi All,
I recently got a new toy, in the form of a pocket PC (mda varrio 3), and want to learn how to program for it in c# using Visual Studio 2008. I have experience of C, Pascal, PHP etc and have a few questions for you all:
1) I have websites with a mysql database and was wondering if c# was good for accessing the data on these websites within an application (not web browser) on my phone?
2) I’m struggling to find basic step by step tutorials that will help me write such an application. Could someone please point me in the correct direction?
3) Are there good websites with lots of c# sample program applications that I can see the code? I have looked on the Microsoft site, but the c# samples seem to be lacking.
Sorry if these questions have been asked before, I had a quick look and couldn’t find what I was looking for ….
Thanks in advance,
Reggie.
Hi,
Connecting from the Phone Directly to MySQL is a bad idea, ideally you should create some sort of webservice or remoting middle tier(afaik .net 3.5 CF supports this). The reason I say this is that the connection string will have to be embedded in the device and anyone with a bit of know how will reverse engineer it and be able to access you MySQL Server.
That said, connecting to MySQL in C# is easy: have a look here for some .net articles : http://dev.mysql.com/usingmysql/dotnet/ (just port the VB to C#).
Thanks
Dave
reggie4 said:
Hi All,
I recently got a new toy, in the form of a pocket PC (mda varrio 3), and want to learn how to program for it in c# using Visual Studio 2008. I have experience of C, Pascal, PHP etc and have a few questions for you all:
1) I have websites with a mysql database and was wondering if c# was good for accessing the data on these websites within an application (not web browser) on my phone?
2) I’m struggling to find basic step by step tutorials that will help me write such an application. Could someone please point me in the correct direction?
3) Are there good websites with lots of c# sample program applications that I can see the code? I have looked on the Microsoft site, but the c# samples seem to be lacking.
Sorry if these questions have been asked before, I had a quick look and couldn’t find what I was looking for ….
Thanks in advance,
Reggie.
Click to expand...
Click to collapse
If you install the Windows Mobile 5.0 or 6.0 SDK (it was an option when you installed Visual Studio, assuming you didn't install the "express" version), or you installed it afterwards, you'll have a directory in C:\Program Files (or your equivalent) for the SDK (for example, on my machine the 5.0 SDK is here:
C:\Program Files (x86)\Windows Mobile 5.0 SDK R2
Under there you'll have everything you'll need to get started. Especially interesting should be the contents of the Samples folder (PocketPC is for devices with touch screens).
Good luck, and have fun!
any c# guide how to connect to mysql would work
.net works the same in 99% of cases on pc and ppc
Thanks Rudegar, I thought as much - but couldn’t find a simple step by step guide including Visual Studio 2008 with example code.
Thanks godefroi, I have had a look in here, but there aren't many c# samples and I can't find one c# to mysql sample.
Thanks DaveShaw, I didn’t explain myself well enough. I have a website with a mysql database on it (on web server) and I wanted to be able to update the site from the net (eg my laptop) and when I am out and about (from my phone). I wanted to write an application that runs on my phone that can read and write data to its own local database (or this web database depending on signal) and then synchronise the local and the web database when 3G signal becomes availabile.
I hope i have explained myself more clearly?
Hey everyone,
So I was just thinking over what I would love to do with my Transformer/Dock combo and one thing came to mind.
I can connect to my office via VPN, access our company intranet and use various web based tools but there's one thing I'm missing: SQL access.
I use GUI tool that lets me have several DB connections open and run SQL in a window along with seeing the results of the query. I can drop or truncate tables, etc also.
So my question is: Does anything like that exist for Android and more specifically, Honeycomb so there's a bigger screen?
Thanks,
-Bob
How about phpMyAdmin or similar installed on one of the SQL servers. Or using remote desktop/VNC to remote control a PC with the MS SQL tools on it.