-
Notifications
You must be signed in to change notification settings - Fork 581
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Server side .net not working! Help needed! #8
Comments
Hi Can you please give me the URL of the DisplayMap.aspx page that is not working. thanks |
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. |
Yes, I would need to access a public url to see what's wrong. |
Hi Nick, here's the url: http://kingsapps.ca/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. |
alos check the data source. WINDOWS8-MBP\SQLEXPRESS is for my machine. |
try this: Data Source=localhost\SQLEXPRESS; instead of: Data Source=WINDOWS8-MBP\SQLEXPRESS; |
You are right. it's not getting data from the DB. But I totally changed the connection string that i usually use. Which is. Is there any more testing you want me to do? |
and you are able to open the database and see the table? |
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. using System; public partial class GetRoutes : System.Web.UI.Page
} |
I also checked in another internal server. There i can see the data from the DB but GetRoutes.aspx still shows the same thing. |
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. |
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. |
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 |
Thanks so much again. I will keep you posted. |
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. |
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. |
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? |
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 |
Hi, Sorry i was away this whole weekend. My name is Azam. protected void Page_Load(object sender, EventArgs e) {
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. |
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 |
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! |
like this? connectionString="Server=localhost\SQLEXPRESS; Database=gpstracker; User Id=sa password=P@ssw0rd" experiment a little. |
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. |
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? |
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 |
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. |
I'm near Seattle. Give me your skype name and I will send an invite. Those times work for me too. |
great. will talk soon then. here's the ID: sazib1942 |
Hi, I was trying to run the .net source that has been provided. I don't get any exceptions or error messages but still i'm not getting any data or map while running on my IIS. I have deployed the DB and .net source the way it is instructed.
I couldn't resolve the issue. I checked the connections string and all the connection configurations in web.config which is fine. I never worked on json. I also suspect map.js is not working properly. Can anyone please enlighten me or show me the way to resolve this issue. By the way, I downloaded the app from google play store and checked on your test page and that's working fine.
The text was updated successfully, but these errors were encountered: