There's not much to it. You just need to declare a string, make it empty : String [myvariablename] = "" then you just need to loop over your byte array : foreach(byte [mybytevariablename] in [mybytearrayname]) then in the loop just concatenate each element. [myvariablename] = [myvariablename] + [mybytevariablename] When your finished, then the string you defind should be a string of all the chars in your byte array which you can then pass to the function. replace the [..] above as appropriate for your variable names where you've defined them.
shawty_ds
Posts
-
byte[] to string -
Refresh of a seperate gridview in an ASP.NET page.Christian, thanks.... that worked excellently. :-)
-
Refresh of a seperate gridview in an ASP.NET page.Thanks Christian, I'll look into that, one more question... Does ths even apply when i'm not doing the original databinding manually, i'm just letting the datasource/datagrid sort it out them selves. Calling the DataBind() proc just seemed like a sensible thing to try to force it to update.
-
byte[] to stringYou need to describe it better than that i'm afraid. the .ToString()??? the function??? the routine??? try to convert your byte array to a string before hand. It's fairly easy. All you need to do is iterate through the array collection and convert each byte to a char before adding it to a string. Cheers Shawty
-
select detail record from gridview using LINQEverything you need to know is in Scott Gutheries Excellent LinqToSql series. Part 5 covers the question you ask http://weblogs.asp.net/scottgu/archive/2007/07/16/linq-to-sql-part-5-binding-ui-using-the-asp-linqdatasource-control.aspx[^] Cheers Shawty
-
How to get a message which user send from his mobile (reply to a message which is sent by application).I think what you mean is you want to intercept the inbound message and then post this into an ASP.NET application? this should help... http://www.ciol.com/content/developer/os/2006/106041301.asp[^] Esentially you need to use the new windows mobile 5 interception class. If your trying to do this on a device less than WM5 then your in for a whole world of pain, beacuse it's not easy. If your trying to do it on a non WM5 device then you'll need to consult the appropriate JSR for the J2ME environment, JSR 213 (I think) as of this writting, but don't quote me on that. Cheers Shawty
-
[Message Deleted]Yes, i would agree with that. In fact this is a perfect thing to use the new dynamic list & linq features for. Somthing like : public class timeEntry { Public String name = ""; Public DateTime time = DateTime.now(); } then make a list of timeEntrys List myList = new List() { new timeEntry(){ name = "London", time = DateTime.Parse("1/1/1 00:00:00") }, new timeEntry(){ name = "Paris", time = DateTime.Parse("1/1/1 01:00:00") }, ... and so on ... }; You can then assign it to a datagrid or anything else in code by using the following : var timeList = from p in myList select p; gridView1.DataSOurce = timeList; gridView1.DataBind(); As your making the list by hand, you can apply what ever maths you want to apply in the relevent areas of the constructor.
-
byte[] to stringYou've declared ciperTextBytes as a byte array, when it needs to be a string. ConvertFromBase64String(string) is telling you that you need to pass the parameter to it as a string data type. I'm not 100% sure with out testing it, but string ciphertext = Convert.FromBase64String(ciphertextbytes.ToString()); !!MIGHT!! work. Cheers Shawty
-
Refresh of a seperate gridview in an ASP.NET page.Hi All, I've been grappling with this for a few days now, and am no further forward, here's the scenario: I have a page that contains the following linqDataSource : productListDS (Selects * from products table) GridView : gridProductList (Data source is productListDS) linqDataSource : productDetailDS (Selects * from products table where id == id) DetailsView : detailsProduct (Data source is productDetailDS) The gridview lists all the products in the data source, with paging and select button enabled, when the select command is clicked the details view is then updated to show all the fields of the selected product and has the 'Edit', 'Insert' and 'Delete' commands enabled. The gridView ONLY shows 5 columns from it's data source (The AutoGenerateColumns option is false) and i'm constructing the colums manually in the columns tag. I have the DataKeys set to id, and when i click the select button everything works flawlessly. My problem comes when i do an Insert/Delete/Update. As an example if i add a new record by putting the details form into insert mode, fill in the fields and then click insert, it inserts the record into the underlying SQLServer database, but the gridview does not update. I've tried doing a 'gridProductList.DataBind()' in the page load, and in the details view 'ItemInserted' event, and still no luck. If however i browse away from the page, and then back the gridView then displays the newly added products. Even pressing F5 to force an update does not work, in fact all that achieves is to resubmit the last insert and add another new record to the DB. The linq Data SOurce is connected to a LInqToSql DBML class. Does anyone have ANY ideas on how to force the Grid View to update and show the table changes made using the details view without having to browse away from the page and then browse back. Cheers Shawty