Hi YOu are assigning string values to byte, thats why its giving error. You can use following code String[] mm = {"A","B","C"}; byte[] by = new byte[3]; for (int i = 0; i < mm.Length; i++) { by[i] = Convert.ToByte(mm[i]); }
goyal manish
Posts
-
copy array string to by byte array -
How to avoid duplicate entries in DataTable.one thing which u can do is to get expected result from sp by using distinct keyword and if in yours case that is not possible. then take a string variable and put whenever you add the row in datatable also add that primay key in this string.(this will containf the comma separated primary keys which have added). and before adding the row to datatable check that whether this primary key is already there in string. //declare string as empty before for loop dr = dt.NewRow(); dr[0] = int.Parse(ds.Tables[0].Rows[k]["ID"].ToString()); //check that string contaims this primary key or not if( string does not contain this primary key) { dr[1] = ds.Tables[0].Rows[k]["COL1"].ToString() dr[2] = ds.Tables[0].Rows[k]["COL2"].ToString() dt.Rows.Add(dr); //add this primary key to string }
-
store datagrid data in a databaseyou have to add code on click of save button in this code ypou will traverse all the rows one by one and will save data of each row one by one. or you can first take data to save in a string for each row data will be comma seperated and rows will be semicolon seperated and at the time of saving you can get sepearate them and then save one row each time.
-
Problem in listbox controli am using listbox server control. When i made selectionmode multiple, it works fine. but when i make selectionmode single, i am unable to deselect any selected ite in list box. In this case if once i select any item then i have to select atleast one item from list and my requirement is to make user able to deselect that selected ite. Need it urgent.
-
Response.End() method in .net2.0 urgent help neededthat i know but i just want to ignore the exception because rest functnality is working fine.
-
Response.End() method in .net2.0 urgent help neededHi I was using Response.End() method in .net 1.x successfully. But in .net2.0 its giving exception "Thread is being aborted." Any solutions for it? Please replay fast its urgent.
-
how to display selected items of a listbox into a datagrid at runtimei think there should not be any problem in this case. Simply get the selected values from list and pass them to get values from database for datagrid.
-
Filling a combo box of airport of the worldbut for that also you have to take data from somewhere else. ultimately somewhere it ahould be already present. Are you trying to get that data from somewhere else, where it is already maintained?
-
Filling a combo box of airport of the worldat least once you have toput all of yhrm in database and then later u can fill urs comboboxes from database.
-
CheckBox Control and RowIDjust put that id in session state or pass it as query string to the edit page.
-
Clone rows based on existing rowstry it insert into FIELDS_IN_VIEW select 24, field from FIELDS_IN_VIEW where view = 23
-
A couple of queries in SQL,Please Help.. -
Sql error in ASP Pagemay be in urs connection string u r missing password.
-
A couple of queries in SQL,Please Help..just use cursor or while loop in urs stored procedure.
-
How can I set a value in a cell of the DataGridView that contains a DataGridViewComboBoxColumn?hi there first use findcontrol function for getting the control combobox then set its value. (controltype)dataGridView1.Rows["RowName"].Cells["ColumnName"].findcontrol("ControlID").value = "1"
-
datagird/com_boxuse template column in datagrid and in that template column you can use any control like combo or text box or radio button or check box etc.
-
string of GUID as Select Parameter in objectdatasourcehi there yes you can use this query but remember to pass @CompanyID as a comma separated string of ids.
-
Print a disclaimer.you can put the portion of code in div which is to be print and then onclick of the print button call a javascript function which will get the div and will print it.
-
How to merge cells in a gridyou can use template column in which you can put a table and in case of header where you want to merge the cells can use colspan and in case of data you can use two diffrent cells.
-
Alert Boxfor javascript on the click of button call a function in javascript there check for value of text box if it is empty then display a alert box with message and return false else pass true without displaying the alert box.