Im using ASP.NET, with c#, with visual studio 2008.
I have a datagrid, and I have a Template column in the datagrid.
I have copied the datagrid from another .aspx. The template column is made for delete purposes(rows of data results),
but I don't need this template column anymore. So I have tried removing it. But when executing I get the error:
"System.ArgumentOutOfRangeException = specified argument was out of range. parameter name index."
The error is thrown when it reaches the line: DataGrid1.DataBind();
How can i fix this ?
Thanks..
I solved it. I had to modify some methods which were called in the InitializeComponent().
Thanks!
Related
I would like to be able to retrieve a value of one of the concatenated string properties (PropertyNames column) for the logged in user.
I looked through the Membership class but could not find any way so far.
Any idea? And what would be the best approach?
Got it! Using System.Web.Profile.
Found the following link helpful about extracting individual properties.
Also, the app was throwing the following error:
Could not load type 'System.Web.Security.SqlProfileProvider'
A change was needed to be made in the Web.Config file
The following link pointed to the main issue
i have a issue while exporting Gridview data into .csv file.I have followed a link to export
This link i have follow please check it. When I run the application it creates just header names, remaining body fields always show null values. Please help me how to export GridView data into .csv file
Maybe your GridView use the template fields, and your property «.Text» is always null.
Suggestion: Put a break-point just in «sw.Write(dr.Cells[i].Text);» and check your Cells[i] object. Search for the property you want to put in the file. Probably you will need to do some cast to catch the right value you want.
Ex.: sw.Write(((TextBox)dr.Cells[i].Controls[0]).Text);
Hope this helps.
I want to get the FileVersion (or ProductVersion) and the Comments fields which are in the "Version" tab of a dll using a c# code.
I tried to use the Assembly class, but didn't find the data I need.
Thanks in Advance.
That's because the Assembly only knows the AssemblyVersion. To get File information, you need to look at the file properties using FileVersionInfo.
I'm writing a small ASP .Net application in order to retrieve data from a SQL database. The application uses drop downs in order to select what the next drop down should contain and when a page is selected, it should retrieve the HTML from the database. Everything is working until it gets to the retrival of the HTML data. When I try to retrieve the data, I get:
Microsoft JScript runtime error:
Sys.WebForms.PageRequestManagerServerErrorException:
An unknown error occurred while
processing the request on the server.
The status code returned from the
server was: 500
The HTML column is a defined as NVARCHAR(MAX), but I can't see this causing a problem. The application works if I set the DataValueField to another column. Has one else come across a problem like this? Maybe someone could shine some light on this?
One thing I noted when dealing with varchar(max) columns is that the framework still commonly expects to have a size associated with it. What I ended up having to do was specify the length as -1 to get it to accept a varchar(max) field. Your error message doesn't indicate that this is the problem, but you might try experimenting with it rather than turning off the validation, which could possibly have other repercussions.
Figured it out. Just needed to set ValidateRequest to false at the Page level.
I have a site in ASP.NET using Telerik AJAX controls.
Despite the latest binary being added to the website project, my code (eg myRadGrid.Datasource = "";) shows a red line on type names as they cannot be found for some reason.
Can anyone possibly explain why or have experience in this sort of problem?
Thanks
Why are you assigning an empty string to the radgrid datasource property? Try setting it to null instead, which is what you do if you want to clear the data source...