|
|
That is the web installer and I' ve already done it.
My only hope is to try the Windows Phone Developer Tools 7.1 Beta, although something keeps telling me that it will not help and maybe I 'll get problems into running VS afterwards (it happened already once during my previous efforts). Thanks anyway...
|
|
|
|
|
Have you installed all of these? (I copied this from a reply I posted elsewhere)...
Download and install the Windows Phone SDK (Windows Phone Developer Tools), the Windows Phone Developer Tools January 2011 Update, and the Windows Phone Developer Tools Fix. They can be found here[^] (look under "Windows Phone Developer Tools 7.0" and follow instructions).
I wouldn't try the beta unless you're willing to be a tester
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I tried everything, even uninstalling and reinstalling all the stuff.
Did not work!
Unhandled exception in XDE.exe... whoever knows why...
I'm thinking of switching into Android, maybe I'll have better luck there
modified on Friday, May 27, 2011 10:19 AM
|
|
|
|
|
You're running Visual Studio as an administrator, yes?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Yes, of course. Meanwhile I succesfully installed it on another machine. I think I'messed it up having installed some of the german and/or the english versions of Visual Studio. But I do not know what to fix or deinstall.
Isn't there any advice in which direction that problem could be resolved? I mean other than just reinstalling everything, which apparently doesn't work...
The machine says the following:
Failed to open XML parser COM object. C:\Program Files (x86)\Microsoft XDE\1.0\WM7_skin.xml
Error while processing skin file C:\Program Files (x86)\Microsoft XDE\1.0\WM7_Skin.xml
View element is either missing or invalid.
What could (or should) be the work around to such a problem?
|
|
|
|
|
nstk wrote: I think I'messed it up having installed some of the german and/or the english versions of Visual Studio.
I thought I remember hearing something about at least one of the WP7 tools only working on EN versions...you may be on to something there.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I wouldn't know. My last hope was installing Blend 4, when I found out that it was not the english version. Alas... it was again only lost time...
It seems however, I am not the only one with that problem, at least it has occured to others before.
http://blog.robgarrett.com/2006/08/15/failed-to-open-xml-parser-com-object/
http://social.msdn.microsoft.com/Forums/en/microsoftdeviceemu/thread/7dff48af-2d25-4a52-a849-2b357b283386
None of those tricks helped me though... still searching, it must have been a long time since I haven't gone beyond the 3rd page on a google search...
|
|
|
|
|
SqlConnection conn = new SqlConnection("");
conn = DataHandler.conn;
String username = txtUsername.Text;
String password = txtPassword.Text;
conn.Open();
SqlCommand cmd = new SqlCommand("SELECT * FROM [TBLUsers]", conn);
cmd.Connection = conn;
DataTable table = new DataTable();
SqlDataReader reader = null;
reader = cmd.ExecuteReader();
while (reader.Read())
{
if (txtUsername.Text == (reader["UserName"].ToString()) && txtPassword.Text = reader["Password"].ToString()))
{
reader.Dispose();
table.Load(reader);
POS2 p = new POS2();
MainPage page = (MainPage)this.MdiParent;
p.MdiParent = page;
p.WindowState = FormWindowState.Maximized;
p.Show();
page.WelcomeUser = reader["UserName"].ToString();
//throw new CustomException("Enter Correct Username and Password");
}
}
I'm getting this error-->Invalid attempt to call MetaData when reader is closed.
What can i do??
thanks in advance
Sandra
|
|
|
|
|
You have to add all your code inside try{}catch{}finally{} and in finally scope dispose datareader and close connection string.
e.g
try
{
}
catch(Exception exp){MessageBox.Show(exp.Message);}
finally
{
if (rdr != null)
rdr.Close();
if (con.State == ConnectionState.Open)
con.Close();
}
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.cacttus.com
|
|
|
|
|
oh my. Lots of comments:
1.
please use PRE tags to improve code readability.
2.
the problem is you dispose of your reader on the first match, and then you continue the while loop which depends on the reader. The dispose should be outside the while loop!
3.
the easier way to get the dispose stuff right is by using a using statement, like so (note the result of PRE tags):
using (SqlDataReader reader = cmd.ExecuteReader()) {
while (reader.Read()) {
if (txtUsername.Text == (reader["UserName"].ToString()) && txtPassword.Text = reader["Password"].ToString())) {
break;
}
}
}
4.
So you are storing usernames and passwords in a table. Do you consider that a good practice?
Normally one would:
- [rephrased] concatenate the username, the password, and a little constant string ("salt"); [/rephrased]
- then call a hashing function;
- and lookup the table, which does not contain the password, all it holds is the hash value.
The reason is this: if your database gets compromised, all users loose the privacy of their password (and most of them would have been foolish enough to use the same username and password on other applications and/or web sites).
Luc Pattyn [My Articles] Nil Volentibus Arduum
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Please use <PRE> tags for code snippets, they improve readability. CP Vanity has been updated to V2.3
modified on Thursday, May 26, 2011 8:09 AM
|
|
|
|
|
Yeah, what Luc said. Plus:
SqlCommand cmd = new SqlCommand("SELECT * FROM [TBLUsers]", conn);
cmd.Connection = conn;
SqlDataReader reader = null;
reader = cmd.ExecuteReader();
txtPassword.Text == reader
And you don't break the loop.
Of course, you should probably use a parameterized query rather than querying the whole table.
|
|
|
|
|
try this:
try
{
SqlConnection conn = new SqlConnection("");
conn = DataHandler.conn;
String username = txtUsername.Text;
String password = txtPassword.Text;
SqlCommand cmd = new SqlCommand("SELECT * FROM [TBLUsers]", conn);
conn.Open();
DataTable table = new DataTable();
SqlDataReader reader = null;
reader = cmd.ExecuteReader();
while (reader.Read())
{
if (txtUsername.Text == (reader["UserName"].ToString()) && txtPassword.Text = reader["Password"].ToString()))
{
table.Load(reader);
POS2 p = new POS2();
MainPage page = (MainPage)this.MdiParent;
p.MdiParent = page;
p.WindowState = FormWindowState.Maximized;
p.Show();
page.WelcomeUser = reader["UserName"].ToString();
}
}
}
catch
{
reader.Dispose();
}
finally
{
conn.close();
}
suchita
|
|
|
|
|
That is hardly any better than the original. I suggest you read the thread again and learn from it.
Luc Pattyn [My Articles] Nil Volentibus Arduum
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Please use <PRE> tags for code snippets, they improve readability. CP Vanity has been updated to V2.3
|
|
|
|
|
I am not suggesting any database table design here.. just gave a simple view on the error mentioned on the original problem.
Invalid attempt to call MetaData when reader is closed.
suchita
|
|
|
|
|
so now:
1. you rely on some exception to dispose of the reader; if no exception gets thrown, the reader isn't disposed.
2. you catch and basically ignore any exception you are getting, a very bad practice.
Luc Pattyn [My Articles] Nil Volentibus Arduum
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Please use <PRE> tags for code snippets, they improve readability. CP Vanity has been updated to V2.3
|
|
|
|
|
thanks, this worked perfectly
|
|
|
|
|
Its my first time to deal with Web Services and I am having errors on consuming Web Methods with parameters. Below is my code.
[WebMethod]
public string HelloWorld()
{
System.Diagnostics.EventLog.WriteEntry("HELLO WORLD INVOKED", "Congratulations, you have just invoked Hello World method of your local Web Service");
return "Hello World";
}
[WebMethod]
public string PostMethod(string test)
{
System.Diagnostics.EventLog.WriteEntry("POST METHOD INVOKED", "Congratulations, you have just invoked Post Method of your local Web Service. Data - " + test.ToUpper());
return test.ToUpper();
}
The way I am calling these web methods are by creating a HTTP POST to http://localhost/Service1.asmx/HelloWorld and http://localhost/Service1.asmx/PostMethod
I am able to invoke HelloWorld method successfully(I can verify it by looking at the Event Log) but when calling PostMethod I always get Internal Server Error. I also tried doing http://localhost/Service1.asmx/PostMethod?test=value but still no luck.
I know this can be solved by searching Google but since I am a beginner, I am not familiar on which direction to search. I tried though but no luck.
Appreciate your help. .
|
|
|
|
|
Try running in the debugger and navigating to http://localhost/Service1.asmx (or right-click the asmx file and choose view in browser).
You should see your methods listed - click one to see sample requests/responses for the method.
(if you run in debugger you can set breakpoints in your methods so you don't have to use log entries...)
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Under the PostMethod method, I can see this section under the HTTP Post
POST /xmlservice1dot1/service1.asmx/PostMethod HTTP/1.1
Host: ***.***.**.**
Content-Type: application/x-www-form-urlencoded
Content-Length: length
test=string
However, its not yet clear to me on how to consume the PostMethod. I was thinking you could consume it by creating an HTTP post to http://localhost/Service1.asmx/PostMethod?test=string but I am not sure if it can be done. I was doing a post to http://localhost/Service1.asmx/HelloWorld and it works fine but I cant get it to work for PostMethod. Can you please suggest a way for me to do it? Thanks in advance.
|
|
|
|
|
samir.abda wrote: I was doing a post to http://localhost/Service1.asmx/HelloWorld and it works fine but I cant get it to work for PostMethod.
From the browser address bar you'll need to be able to call using GET.
Add this to your web.config in the system.web section:
<webServices>
<protocols>
<add name="HttpGet"/>
</protocols>
</webServices>
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
That seemed to do the trick. Thank you.
Another question, given that http://localhost/Service1.asmx/PostMethod?test=string already works, is there a way to make the value of test dynamic? Like putting it in an XML for example? I tried posting something like the XML below to the web method but it does not work. Hope you can help me with a solution.
<test>This is a test string</test>
|
|
|
|
|
What do you mean by "make the value of test dynamic"?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
For example, if I post to this URL, http://localhost/Service1.asmx/PostMethod?test=string, the value of the parameter test would be string . Is there a way to do this dynamically, like call http://localhost/Service1.asmx/PostMethod and just post the XML containing the value for the test parameter?
|
|
|
|
|
Are you doing this from code? I have no idea how you're consuming your web service
If you're calling your web service from another application, Visual Studio can create a servicereference for you which will give you a nice proxy class you can use to call the web service methods just like they're local...
Mark Salsbery
Microsoft MVP - Visual C++
modified on Thursday, May 26, 2011 4:40 AM
|
|
|
|