DataSource Controls :: How To Implicitly Convert Datatable To String
Jul 30, 2010
I'm having a problem with reading a string from sqlserver database and use it as the text of a label,
getDescTableAdapter gd = new
Label2.Text = Convert.ToString(gd.GetDesc(pid));
what i get in the form is: getDesc ! everything is right in the dataset and if i bind it to a gridview it works fine but when i convert it to string it seems it converts the table adaptor's name instead of the value.ance
I have a products table with 3 fields name, price and quantity, I need to fill a datatable with those 3 fields and using a foreach build a chain. I build my chain currently using a datagrid with my following code
this code work good.
string item_name; string amount; string quantity;
but I like to form my chain directly from datatable, not rely on a datagrid.
I have store procedure which return result set. I have used LINQ datacontext object to get the result set from this store procedure, which returns the result set in IsingleResult format.I bind this IsingleResult to my gridview.
I want to convert this IsingleResult into DataTable format so I can sort the gridview.
I have a datalist which querys the database and pulls the data ApplicantID, date, and testimonial into the datalist. I now want to get the username from the ApplicantID. Im using TLists to do this but on the line ApplicantDetails = JustClick.DAL.DataRepository.ApplicantProvider.GetByApplicantID(ApplicantID);
im getting the error cannot implicitly convert type on datalist can anyone help as to why and how I can fix this cheers. The code im using is below
I need to limit the length of the string that load into a DataTable that is being used to display. The data I am loading is coming from another DataTable. How do I shorten row["CG_GalleryName"] contents to 24 characters.
Convert.ToString(row["CG_GalleryName"]) -- how do I set this length to 24 characters? Using it in the below code.
I'm having a asp.net listbox on the front end webform with multiple selection, after user selecting multiple items, i'm capturing the DataKeyValue of listbox(which is amenity_id of bigint) and looping all the selected items to a string with comma sepearated values. For example if user selects first 4 options, my output string will be like this (1,2,3,4) and i'm passing this as a string type to my data access layer and then to my below stored proc. I'm geting this error while inserting.. i know that my data type is of bigint and i'm trying to insert string type. i need to convert the string type to INT type and insert data. below are my stored procs:
This is where i'm splitting the comma seperated values and inserting them into table.
so i have the function below in a webservice. and it works, but when i try to copy it to aspx page code behind, i get the message in the subject. Can someone tell me if the function below is valid? One of my project uses it and it works.