Security :: VB.NET Returns System.String[] Instead Of The Actual Value Of The String
Dec 24, 2010
I have two sub routines that I've created to pull in my Membership user roles and assign the value/name of that role to the value of a cookie.
My first subroutine looks like this
[Code]....
At this point, role ID is a 1-dimentional array which is not acceptable for a cookie's value (it must be a string), but in Debug mode, I can see that the array does contain the correct roleID value. In my 2nd subroutine I change the value from array to string for no other reason than that it gives me an opportunity to see that the value of CookieValue() before it is converted does have the correct roleID.
[Code]....
Even though it still shows that string as having the correct value, it returns the object "System.String[]"
At debug time I would like to see what are the keys in my InitParams collection - I can't seem to be able to list them.
EDIT:As Jon suggests below, this might be a bug within the Silverlight debugger. To reproduce, just create a new Silverlight Application within Visual Studio 2010 and just edit code
{ public partial class MainPage : UserControl { [code]...
In my code below, I'm trying to re-write a string and convert and http text into actual web links.
It doesn't seem to be working and I think the problem may be that I'm rewriting the string and inserting another http string into the original string which then causes problems with the loop.
The reason that I select elements by css class selector ($(".classificationFolder")) is that, this control is a user control and used in the same page more than once. That is why I'm not using $("#searcher").
I tested the code In IE8 and Chrome 8.0.552.28 beta. This issue is arising in both of the browsers.
On the other hand, request is sent to the server, client received response successfuly and response is processed on the client.
I am attempting to use SqlBulkCopy to import data from an XML document. I receive the following error when executing WriteToServer: Invalid cast from 'System.String' to 'System.Guid'
I'm trying to encrypt some userData to create my own custom IPrincipal and IIdentity objects using Forms authentication - I've serialized an object representing my logged in user to Json and created my FormsAuthentication ticket like so:
string user_item = GetJsonOfLoggedinUser();/*get JSON representation of my logged in user*/
i have a function which returns a value from a query string parameter, i use it in more than 10 places in the webapp thus i have to rewrite the code every time, again and again.so to make it short, is there any way i can embed the code somewhere and keep referring to it through out my app?
This is completely frustrating and probably embarrassing as well. A while back I posted a similar question and resolved the issue. [URL]...scope_identity The program has been working ever since, until yesterday when as it turns out SCOPE_IDENTITY() started returning an empty string even though a record is being inserted. I am not sure what has changed since the fateful day.
[Code]...
I am hoping that there is something I am just not seeing here. A lot of the information I have seen thus far indicates that there are problems with SCOPE_IDENTITY() but most of those are related to inserting multiple records. As you can see this should be fairly straight forward. The thing that really has got my goat is that it used to work and now it doesn't. If someone could take a look at the above code and comment on any anomalies it would be great. Also I have heard suggestions for switching to ADO.NET and it is beginning to look a lot more attractive every day. But I have a ways to go before making the switch so it is SqlDataSources for now
I have developed a web application 3 months ago to show facebook users by searching username. To access facebook, I have downloaded facebook dll and got application key, and secret key from facebook. My web application was working fine and displaying records from facebook. yesterday onwards, my application is not working fine. I could not get response when I search by name. I have tested the fql in the facebook testAPI tool online. That time i can get response. but the same fql i used in my appliation but it could not get response from facebook when I search by name. If i search by uid i can get response from facebook. here is my code.
facebook.Components.FacebookService fb = new FacebookService(); fb.ApplicationKey = "bfeefa69afdfe81975f0d6136ace3009"; fb.Secret = "9b672d682e1d8befd06382953fc2615b"; fb.IsDesktopApplication = false; //the below fql gives response as xml. //select name, profile_url from user where uid = '1730923544' -I can get response for this fql. //the below fql does not give response as xml. But it gives empty string. //the below fql does gives us response as xml when i try in facebook testAPI. //select name, profile_url from user where name = 'Suresh Rajan' -I couldn't get response for this fql. string s = fb.fql.query("select name, pic_square, profile_url from user where name = 'Suresh Rajan'"); if (String.IsNullOrEmpty(str1)) Response.Write("Empty Response"); else Response.Write(str1 + " ");
I have an issue with some content that we are downloading from the web for a screen scraping tool that I am building.in the code below, the string returned from the web client download string method returns some odd characters for the source download for a few (not all) web sites.I have recently added http headers as below. Previously the same code was called without the headers to the same effect. I have not tried variations on the 'Accept-Charset' header, I don't know much about text encoding other than the basics.The charachters, or character sequences that I refer to are:
"" and "Â"
These characters are not seen when you use "view source" in a web browser. What could be causing this and how can I rectify the problem?
string urlData = String.Empty; WebClient wc = new WebClient(); // Add headers to impersonate a web browser. Some web sites // will not respond correctly without these headers wc.Headers.Add("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12"); wc.Headers.Add("Accept", "*/*"); wc.Headers.Add("Accept-Language", "en-gb,en;q=0.5"); wc.Headers.Add("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7"); urlData = wc.DownloadString(uri);
Basically, what I did is that: I have a table in SQL database and some of data fields allow null. I built Objectdatasource through dataset. When I built update page using dataset. It generate the following error before showing the update page correctly. It seems I have issue to retrieve the null value from the database through using objectdatasource through dataset. Any suggestions?An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code
I am trying to write a table output from SQL database to a gridview/ Data List through an Object Data Source. I am a new starter and your help will be useful.
public List<Staff> GetStaff() cmd.CommandType = SqlConnection con = new SqlConnection(connectionstring);SqlCommand cmd = new [code]...
Above is my code. The error I'm get is, Unable to cast object of type 'System.DateTime' to type 'System.String'.
The column "To" and column "Subject" are strings and column "Receive" is DateTime. I can't made any changes in the database, so I need to write some code to handle casting a string to datetime or if statement as a work around.
[Code].... System.InvalidCastException was unhandled by user code Message=Unable to cast object of type 'System.Guid' to type 'System.String'. Source=System.Data.Linq System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execut
I am trying to pull string values from LDAP. They are all text attributes in LDAP. I'm able to pull all values successfully from LDAP except one attribute below. following line of code displays System.Byte[] instead of actual string value. Why is it showing System.Byte[] and how can I fix it?