|
Crap - I forgot you're using the CF. The property may be missing for that version of .NET.
/ravi
|
|
|
|
|
Some more thoughts:
- Have you tried setting the timeout of the client proxy (at run-time) to a comfortably high value?
- Is there an uncaught exception occuring on the service end?
- Is the returned list guaranteed to be not-
null ?
/ravi
|
|
|
|
|
You think like me , that was som of the first things I tried - without success.
Ravi Bhavnani wrote: Have you tried setting the timeout of the client proxy (at run-time) to a comfortably high value?
Yes, tried that as the first thing. Changed timeout to 180 seconds (server responds in less than 4 seconds).
Ravi Bhavnani wrote: Is there an uncaught exception occuring on the service end?
Not likely. The server always responds with, at least, a empty List within 4 seconds.
(same for another test-method that simply takes a string and returns the same string).
Ravi Bhavnani wrote: Is the returned list guaranteed to be not-null?
Yes. (at minimum it's a empty List of objects).
modified on Monday, January 17, 2011 6:54 PM
|
|
|
|
|
I am researching a job position and was curious if anyone deals with Dynamics GP on the regular? I am basically wondering if this is a new language that I will have to learn or can I utilize C# and/or vb.net to work with it? I viewed a project that was created in this a few months ago and looked like really ugly code.
I am weighing the pro's and con's of this and deciding if it would be worth leaving a job using c#/vb.net to go exclusively to developing GP. Is it a great pain or nice to work with? Can you use c# or vb to code or do I have to use the ugly code I viewed sometime ago?
Thanks,
|
|
|
|
|
Thanks, but I finally figured it out.
I am fairly new to VB.net but I am getting by. I am almost clueless about C# though. I have managed to find a C# function that does what I need
and have converted it with the online code converter. It runs in VB and works but two of the four calculations are not working. (I had hoped to get it
working in C# to test the formulas.) It takes a string (a mapping Tile Quadkey, 02311102221333130 for example) and calculates the bounding box for that
map tile(Lat/Lon) corner positions coordinates of the four corners). The calculated values W (West Longitude) N (North Latitude) E (East Longitude) and
S (South Latitude). I have set up a new C# project, a console app. I have used the code at bottom and created a new class in that program. On the form Program.cs
I don't have a clue about how to make use of that class. The test value would be Quadkey = "02311102221333130"
It appears that it returns a string of the array bounds, values separated by commas.
If someone wanted to convert this to working VB.net that would really great, but I hardly expect that.
The corrected, working calling procedure. I guess that I knew even less than I thought.
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
WMSHandler outCl = new WMSHandler();
double N = 0;
string MyString = outCl.QuadKeyToBBox("02311102221333130");
Console.WriteLine(MyString);
Console.ReadLine();
}
}
}
But that is not working. Any help would be appreciated.
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
using System;
using System.Math;
using System.IO;
public class WMSHandler
{
public const int TILE_HEIGHT = 256, TILE_WIDTH = 256;
public string QuadKeyToBBox(string quadKey)
{
int zoom = quadKey.Length;
int x = 0, y = 0;
for (int i = zoom; i > 0; i--)
{
int mask = 1 << (i - 1);
switch (quadKey[zoom - i])
{
case '0':
break;
case '1':
x |= mask;
break;
case '2':
y |= mask;
break;
case '3':
x |= mask;
y |= mask;
break;
default:
throw new ArgumentException("Invalid QuadKey digit sequence.");
}
}
double W = (float)(x * TILE_WIDTH) * 360 / (float)(TILE_WIDTH * Math.Pow(2, zoom)) - 180;
double N = (float)Math.Asin((Math.Exp((0.5 - (y * TILE_HEIGHT) / (TILE_HEIGHT) / Math.Pow(2, zoom)) * 4 * Math.PI) - 1) / (Math.Exp((0.5 - (y * TILE_HEIGHT) / 256 / Math.Pow(2, zoom)) * 4 * Math.PI) + 1)) * 180 / (float)Math.PI;
double E = (float)((x + 1) * TILE_WIDTH) * 360 / (float)(TILE_WIDTH * Math.Pow(2, zoom)) - 180;
double S = (float)Math.Asin((Math.Exp((0.5 - ((y + 1) * TILE_HEIGHT) / (TILE_HEIGHT) / Math.Pow(2, zoom)) * 4 * Math.PI) - 1) / (Math.Exp((0.5 - ((y + 1) * TILE_HEIGHT) / 256 / Math.Pow(2, zoom)) * 4 * Math.PI) + 1)) * 180 / (float)Math.PI;
double[] bounds = new double[] { W, S, E, N };
return string.Join(",", Array.ConvertAll(bounds, s => s.ToString()));
}
}
}
modified on Monday, January 17, 2011 11:18 AM
|
|
|
|
|
Don't bother converting it. Leave it in VB.NET as a class library, and add that as a reference to any application that needs it. The whole point of .NET is supposed to be language neutrality.
|
|
|
|
|
I Agree, but if you want to see how it can be done in c#, create a new WinfowdFormsApplication and take a look at it's Program.cs
|
|
|
|
|
Why would I want to do this? The OP doesn't get replies to posts sent to me, so you might want to address it to him instead.
|
|
|
|
|
Pete O'Hanlon wrote: The OP doesn't get replies to posts sent to me, so you might want to address it to him instead.
Ooops, didn't know that, 'cause That's the most common way in other forums
|
|
|
|
|
When I ran it through the converter found here:
http://www.developerfusion.com/tools/convert/csharp-to-vb/[^]
I got this:
Public Function QuadKeyToBBox(quadKey As String) As String
Dim TILE_HEIGHT As Integer = 256
Dim TILE_WIDTH As Integer = 256
Dim zoom As Integer = quadKey.Length
Dim x As Integer = 0
Dim y As Integer = 0
For i As Integer = zoom To 1 Step -1
Dim mask As Integer = 1 << (i - 1)
Select Case quadKey(zoom - i)
Case "0"C
Exit Select
Case "1"C
x = x Or mask
Exit Select
Case "2"C
y = y Or mask
Exit Select
Case "3"C
x = x Or mask
y = y Or mask
Exit Select
Case Else
Throw New ArgumentException("Invalid QuadKey digit sequence.")
End Select
Next
Dim W As Double = CSng(x * TILE_WIDTH) * 360 / CSng(TILE_WIDTH * Math.Pow(2, zoom)) - 180
Dim N As Double = CSng(Math.Asin((Math.Exp((0.5 - ((y * TILE_HEIGHT) / (TILE_HEIGHT)) / Math.Pow(2, zoom)) * 4 * Math.PI) - 1) / (Math.Exp((0.5 - ((y * TILE_HEIGHT) / 256) / Math.Pow(2, zoom)) * 4 * Math.PI) + 1))) * 180 / CSng(Math.PI)
Dim E As Double = CSng((x + 1) * TILE_WIDTH) * 360 / CSng(TILE_WIDTH * Math.Pow(2, zoom)) - 180
Dim S__1 As Double = CSng(Math.Asin((Math.Exp((0.5 - (((y + 1) * TILE_HEIGHT) / (TILE_HEIGHT)) / Math.Pow(2, zoom)) * 4 * Math.PI) - 1) / (Math.Exp((0.5 - (((y + 1) * TILE_HEIGHT) / 256) / Math.Pow(2, zoom)) * 4 * Math.PI) + 1))) * 180 / CSng(Math.PI)
Dim bounds As Double() = New Double() {W, S__1, E, N}
Return String.Join(",", Array.ConvertAll(bounds, Function(s__2) s__2.ToString()))
End Function
I have no idea how this is going to work because I just converted it and pasted it here (with some corrections where the converter incorrectly inserted backslashes in the converted code).
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
Thanks, I just tried it again myself and got another error message"-- line 3 col 8: invalid TypeDecl"
That is the converter that I was using yesterday.
Anyway the conversion that you posted is something that I can work with. Thanks again.
|
|
|
|
|
I would like to develop a simple application to connect to a free version of sql server i.e. sql server 2005 express.
Question:
1-
Does sql server 2005 express have the same window i.e object explorer, management studio window as the other version of sql servers i.e. enterprise. i.e. where one can create a database, table, stored procedures, run queries...?
2-
Is it just one .exe or should I install other files too so that I can work with it as I do with the sql server management studio?
3-
For the connectionstring, should there be .mdf in th estring or just connection to the machine name with the sql server express installed? see below:
Data Source=myServername\SQLEXPRESS;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;
Server=.\SQLExpress;AttachDbFilename=c:\mydbfile.mdf;Database=dbname; Trusted_Connection=Yes;
Thanks
|
|
|
|
|
1) Yes it has a Management "window". Try SQL 2008 R2 express. lots added, file size limit 10GB...
2) It should be one big exe or a msi or ....
3) depends. the second use requires the SQLExpress to be installed on each machine. Better use access in that case.
The first one allows multiple clients to contect to the same server, and use sql a a db server. There's a catch though.
As far as I know the Express version uses just one CPU even if you have 8(cores or pysical).
All the best,
Dan
|
|
|
|
|
I have always used sql server in large scales.
So, since this is a small project and the client may end up getting the paid sql server version in th efuture, may be it is best if I develop the c# application against the sql server 2008 express ?
|
|
|
|
|
Yep. But warn the clients. That if the user base gets big they must upgrade/buy the full SQL Server.
All the best,
Dan
|
|
|
|
|
MDL=>Moshu wrote: Better use access in that case.
Wash your mouth out with soap.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
I wouldn't let CG touch my Abacus!
|
|
|
|
|
Too expensive for me!
Joke aside I mean it.
It's faster, lighter. Many pros for using it as a single user or local db vs sql.
SQL Lite is another one bettern suited for local dbs.
All the best,
Dan
|
|
|
|
|
MDL=>Moshu wrote: Many pros for using it as a single user or local db vs sql.
The one thing that kills it for me is the non standard SQL.
The advantages to me of SQL Lite, SQLExpress and Compact is the ability to use SQL that will still work if your app gets scaled to a full Server situation.
Although if you are only using Access VBA it is perfectly fine.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
I wouldn't let CG touch my Abacus!
|
|
|
|
|
Henry Minute wrote: non standard SQL
There is no such thing like a "standard" SQL - the "S" in "SQL" is supposed to mean "structured". There are lots of differences between different database types, and the differences in SQL between Microsoft SQL Server and Access are really small.
|
|
|
|
|
SQL Server 2005 Express Edition is free to download, has no time limits, and is freely redistributable (with registration). With a database size limit of 4 gigabytes (GB) and support for 1 CPU and up to 1 GB of RAM, SQL Server 2005 Express Edition is suitable for application embedding or lightweight application development.
1. It can support following products along with it.
* SQL Server Management Studio Express
* SQL Server Configuration Manager
* SQL Server Surface Area Configuration tool
* SQL Server Business Intelligence Development Studio.
but, remember database size is limited to 4GB.
2.
You have to install SQLEXPR.EXE[^]
for SQL Server Express Edition.
You may install SQLEXPR_TOOLKIT.EXE[^]
for sql server toolkit, which includes:
-SQL Server 2005 Management Studio Express Edition
-Business Intelligence Development Studio (BIDS)
3.
First option is just find. we do not mention db filename, unless we attach it to project and is inside project.
Hope this helps 
|
|
|
|
|
Hi,
Thanks for the reply guys...
In regards to below:
"3.
First option is just find. we do not mention db filename, unless we attach it to project and is inside project."
Please elaborate. I remember seeing somewhere where in a project the name of the sql express was placed inside the connectionstring. Also I remember seeing that .mdf was being used within the application.
Since this is a small project with one user to begin with (Number of users may increase to say 5 maximum in the future), should I place the mdf inside the project?
Thanks
|
|
|
|
|
A typical connection string where the database is already attached to SQL Server 2008 Express.
"Data Source=POWERPC\\SQLEXPRESS2008;Initial Catalog=Northwind;Integrated Security=True"
and where it is not already attached
"Data Source=.\\SQLEXPRESS2008;AttachDbFilename=E:\\SQLExpress\\NorthWind\\NORTHWND.MDF;Integrated Security=True;User Instance=True"
Basically the Express versions of SQL Server are the same as the full version, same engine etc., it's just that some of the tools and functionality have been disabled.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
I wouldn't let CG touch my Abacus!
|
|
|
|
|
Hi,
I am unable to connect to the sql2005express on my laptop
The error I get is:
login failed for user 'UserA'. the user is not associated with a trusted sql server connection
Note that sql server is set for both windows and sql authentication modes.
UserA is created in the login to have access to the database "DBName"
Data Source=.\SQLEXPRESS;Initial Catalog=DBname;User Id=UserA;Password=password
If I use the following connectionstring then it works fine
Data Source=LAPTOPName;Initial Catalog=DBname;IntegratedSecurity=True
Question:
How can I connect successfully to sqlExpress in my laptop please?
Thanks
|
|
|
|
|
At least you are able to connect using Windows Authentication.
The only time that I have seen the error message you are getting is when I have not had SQL Server Authentication turned on, even though I thought it was. So I can only suggest that you double check this, perhaps by following the steps in the post from yeukwong999 in this[^] thread on MSDN.
Once you are sure that it is turned on, if it still fails then I am stumped. In that case I suggest that you raise a new question, which will be seen by more people than will see this thread.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
I wouldn't let CG touch my Abacus!
|
|
|
|
|
another thing to keep in mind is that Microsoft wants you to sign a distribution agreement with them if you are making a product that installs SQL Server Express. If this is something that the end user installs separately, then I think you would not have to have a signed agreement, but if you are building a system with it included, you should. We have signed it with MS for our application at work.
Steve Maier
|
|
|
|