Comments (29)
Hi
Can you please give me the URL of the DisplayMap.aspx page that is not working.
thanks
Nick
from gpstracker.
Hi, Thanks for you response. Did you mean public url? If yes then i will let you know soon. I have a IIS server where i hosted that .net source. I don't think you can access that publicly. Let me see what i can provide you.
from gpstracker.
Yes, I would need to access a public url to see what's wrong.
from gpstracker.
Hi Nick, here's the url: http://kingsapps.ca/GPSTracker/
Hopefully you can access this. The database has the data which you have provided with the .bak file. I guess it is supposed to load at least those data when the page loads.Please let me know if you have any queries. Thanks.
from gpstracker.
When I try to access the following page:
http://kingsapps.ca/GPSTracker/GetRoutes.aspx
I get an empty response (except for the trailing json ] } which comes from the GetRoutes webpage.
are you sure that your connection string in the Web.config file is correct?
connectionString="Data Source=WINDOWS8-MBP\SQLEXPRESS;Initial Catalog=GPSTracker;Persist Security Info=True;User ID=sa;Password=gpstracker"/>
is the name of your database GPSTracker and is the sa password of your database gpstracker?
it's not getting the data from the DB.
from gpstracker.
alos check the data source. WINDOWS8-MBP\SQLEXPRESS is for my machine.
from gpstracker.
try this:
Data Source=localhost\SQLEXPRESS;
instead of:
Data Source=WINDOWS8-MBP\SQLEXPRESS;
from gpstracker.
You are right. it's not getting data from the DB. But I totally changed the connection string that i usually use. Which is.
connectionString="Data Source=[server ip];Initial Catalog=GPSTracker;Persist Security Info=True;User ID=xxx;Password=xxx"/>
Is there any more testing you want me to do?
from gpstracker.
and you are able to open the database and see the table?
you have hidden the user name and password in the string above. Did you add the new user permissions to the GPSTracker db?
from gpstracker.
I just checked using the grid view if it can access the database or not and found it shows the data while i am in local db but it doesn't pull data from the other sql server that i am suppose to use. Is it because of some access permission? But both the cases GetRoutes.aspx shows the same thing that you mentioned.
GetRoutes.aspx file contains below code:
using System;
public partial class GetRoutes : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
// our helper class to get data
DbJsonReader reader = new DbJsonReader();
Response.AppendHeader("Content-Type", "application/json");
Response.Write(reader.getJsonString("prcGetRoutes", "routes"));
}
}
from gpstracker.
I also checked in another internal server. There i can see the data from the DB but GetRoutes.aspx still shows the same thing.
from gpstracker.
Hey, can we please keep the conversation here and not split it off onto websmithing (too confusing to keep track). Try this from within Sql Server Management Studio. Open the GpsTracker database and on the toolbar, click "New Query" and execute the following code:
exec prcGetRoutes;
if this runs and returns data, then you know its a permission problem. If it does not return data, the make sure the table gpslocations has data in it.
from gpstracker.
I'm sorry about that. You put a comment after mine so i thought i should reply that.
So i executed that stored procedure. At first place, it was showing a collation conflict. Then i made a little change in the procedure added COLLATE database_default around "=" operator in the query. After that it worked and was showing data on the map which i ran from my local server. I guess i need to check my public server for the permissions. Thanks so much for help. It would be really useful tool for me. I might bother you sometimes if any issue comes up.
from gpstracker.
Ok, good. If you are getting data from that stored procedure then it's definitely a permission problem. Googling is going to be the best way to solve that problem. Let me know if you get entirely stuck again and also let me know if you get the whole thing working. Good luck with it.
n
from gpstracker.
Thanks so much again. I will keep you posted.
from gpstracker.
Hi Nick, Sorry to bother you again. I kinda stuck again while uploading the gps data. I used http://kingsapps.ca/GPSTracker/updatelocation.aspx as a up loader site but seems like database is not updating.Can you please give me a clue what's happening in here again? By the way i change my database server, Hopefully you can now access that url and see whats happening. Thanks in advance.
from gpstracker.
This is a little bit trickier to deal with. The first thing you need to do is take a look at your IIS server logs. Google the location of the logs and then take a look at the access and error logs. That is the first step. Let me know what you find.
from gpstracker.
I've gone through the logs but didn't find anything that might give me some clue. Everything looks fine to me. updatelocation supposed to be http post which should be on port 80 and also the status code is 200 which means successful. logs are like:
2014-05-09 12:34:01 192.168.1.1 POST /GPSTracker/updatelocation.aspx - 80 - 142.177.198.61 android-async-http/1.4.4+(http://loopj.com/android-async-http) 200 0 0 130
By the way, I used the correct upload website url, right? I have to use updatelocation.aspx, right?
from gpstracker.
By the way, what's your name?
In a situation like this, we need to isolate the problem. We don't know if the problem is from the phone to the upload webpage or from the webpage to the database (or both), so we need to break it down. I am suspecting a permissions problem still so that is where I would start. Take a look at the upload webpage:
https://github.com/nickfox/GpsTracker/blob/master/servers/dotNet/UpdateLocation.aspx.cs
comment out lines 11 - 26 and in lines 35-46, fill in some fake values (make sure they are the correct format) and then submit that page. If it fails to update the db, we have isolated part of the problem. So do this for starters and see where the problem is.
n
from gpstracker.
Hi, Sorry i was away this whole weekend. My name is Azam.
So I tried using your strategy but the result is the same.No data is uploading to the DB. Here's the code that you wanted me to do after commenting out.
protected void Page_Load(object sender, EventArgs e) {
//string latitude = Request.Form["latitude"];
//string longitude = Request.Form["longitude"];
//string speed = Request.Form["speed"];
//string direction = Request.Form["direction"];
//string distance = Request.Form["distance"];
//string date = Server.UrlDecode(Request.Form["date"]);
//// convert to DateTime format
//date = convertFromMySqlDate(date);
//string locationMethod = Server.UrlDecode(Request.Form["locationmethod"]);
//string phoneNumber = Request.Form["phonenumber"];
//string sessionID = Request.Form["sessionid"];
//string accuracy = Request.Form["accuracy"];
//string eventType = Request.Form["eventtype"];
//string extraInfo = Request.Form["extrainfo"];
// our helper class to update the database
DbWriter dbw = new DbWriter();
try {
// update the database with our GPS data from the phone
dbw.updateDB("prcSaveGPSLocation",
new SqlParameter("@latitude", 45.079369),
new SqlParameter("@longitude", 2.350800),
new SqlParameter("@speed", 0),
new SqlParameter("@direction", 0),
new SqlParameter("@distance", 0),
new SqlParameter("@date", "2014-05-12 16:16:39"),
new SqlParameter("@locationMethod", "android"),
new SqlParameter("@phoneNumber", "542"),
new SqlParameter("@sessionID", "1111"),
new SqlParameter("@accuracy", 85),
new SqlParameter("@eventType", "true"),
new SqlParameter("@extraInfo", "valid"));
}
catch (Exception ex) {
Response.Write(ex.Message);
}
}
// convert to datetime string
private string convertFromMySqlDate(string date) {
DateTime dt = DateTime.ParseExact(date, "yyyy-MM-dd HH:mm:ss",
System.Globalization.CultureInfo.InvariantCulture);
return dt.ToString();
}
But then I tried in a different way bypassing your helper class(DbWriter.cs). Just executed the stored procedure on a submit button after manually giving input using webform. It worked in this case. I didn't include my one cause its too long.
from gpstracker.
Hey Azam, pleased to meet you.
Try this as a test. In your connection string, use the sa user and password. I'm pretty sure its a permissions problem. This will hopefully tell us if my thinking is correct.
And check out this tutorial on permissions.
http://www.codeproject.com/Articles/674930/Configuring-IIS-ASP-NET-and-SQL-Server
but first try the sa account and let me know if that fixes the problem (just for a test).
Nick
from gpstracker.
Nice to meet you too! But in this testing what would be the data source if i use username and password as "sa"? Because with this username and password and same old data source is not giving me anything!
from gpstracker.
like this?
connectionString="Server=localhost\SQLEXPRESS; Database=gpstracker; User Id=sa password=P@ssw0rd"
experiment a little.
from gpstracker.
The upload site i use is connected to a different server not the localhost. I also use sql server localdb as data source or server. But i guess the upload site that i can use in the android phone can't access that local db. Sorry may be i'm not understanding or little bit confused.
from gpstracker.
Hi Nick, sa account didn't solve the problem. It doesn't even load the route.
I also checked the tutorial of IIS and SQL configurations and made few changes in mine. But still the problem is the same. The SQL server and IIS that I'm using for this is being used for few websites which are running totally fine.
Whenever i try to submit data from webforms directly to the DB using the stored procedure it works. I also tried your suggestion to submit fake values directly to the db. Like i said before it didn't work out. I tried few different ways using sqlcommand and sqlparameters. It just takes the text value from the webform inputs but it doesn't submit direct values or request.form(upload site used in client side) values to the DB. I'm wondering if you are getting any clue from this.
Do i have to look in to the client side code of android?
from gpstracker.
I really don't think there is anything wrong with the code. I still think it's a permissions problem. Maybe within sql server. Check to see what the permissions are on all of the stored procedures. If you can't find a problem, then let's a schedule a time to skype. I would need to be able to control your desktop for a few minutes and it would have to be the machine that has access to the sql server and iis. First check the permissions on the procedures in the db.
n
from gpstracker.
I checked the stored procedure and also added few extra permissions. But I don't see any changes yet. Just another thing I'm wondering, do i have to build or compile the client side android code? I just downloaded from google play store and saved my upload site on that. Hope that's as simple as that.
That would be great if you can schedule a skype meeting. But the problem is, I may not be able to give you the full access to sql server and iis. You can access the db using SQL Server Management studio from my desktop and also can see the server side .net codes but I might not be able to give you access to the server machine. But i will see what i can do.
By the way, what time zone are you in? I'm in Atlantic time zone. What time would be good for you? I prefer between 8am to 5pm ADT in weekdays.
from gpstracker.
I'm near Seattle. Give me your skype name and I will send an invite. Those times work for me too.
from gpstracker.
great. will talk soon then. here's the ID: sazib1942
from gpstracker.
Related Issues (20)
- WakefulBroadcastReceiver deprecated HOT 1
- issue with server code execution using wamp
- displaymap.php doesn't show the map HOT 11
- Can't access database HOT 11
- plc
- plc
- Phone not returning GPS coordinates HOT 5
- Map tracker
- Wow
- Isn't she amaaaaazing!!!!!!
- Fix new api key requirement of google HOT 1
- Feature request: connect the gps points on the map with a direction indication
- Feature request: Have multiple route definition options
- Server Is Freezing after 3-4 days HOT 12
- LocationService going down after 5 minute idle HOT 2
- Server response is too slow after 100 clients HOT 7
- updatelocation.php is not called when php is on web
- Just a question HOT 15
- Interval every 5 minutes at least without being connected to the power AC
- Oreo Android 8 or Android 8.1 HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gpstracker.