|
Hi
If u r successful in populatating GridView at the time of Pageload without paging,here is the procedure to add paging to u r GridView.
1.First goto GridView Properties, set the value for AllowPaging to "true".Then you can see the page numbers below u r GridView.
2.Then goto Events of GridView and double click "PageIndexChanging" event and write a small code in it.
GridView1.PageIndex=e.NewPageIndex;
After this, again write the code for Binding GridView with u r table or stored proc in the same event.
It is better to put your GivdView Binding code in a function and call it in PageLoad and in this PageIndexChanging event.
Cheers
Chandu
|
|
|
|
|
Hi, suppose I want to dislay a file that was stored in a blob in the same format as the origianal file before it was sent to the database, how would I do that? I know how to read a blob but I'm not sure how to retain the formatting of the orignial file. Any suggestions will be grately appreciated, thanks for your help.
|
|
|
|
|
If the file doesn't contain the formatting, then that formatting is lost. What sort of file are you talking about ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I am talking about text files like ms word, notepad, etc. So you're saying that when I display the files, they should have the original formatting?
|
|
|
|
|
If you open a Word file, that file contains it's own formatting, where else would it be ? The only formatting in a txt file is the line breaks and tabs, and it's up to you how you display it, if you respect those, or not.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
I have a grid view I am trying to invisible the fifth column. The rows are now not showing any data in column but the column name is still showing. I want to make invisible column name also.
if (e.Row.RowType == DataControlRowType.DataRow )
{
e.Row.Cells[5].Visible = false;
}
seema
|
|
|
|
|
hi
just write
gridviewname.columns[index].Visible = false;
ex:
dvPOSelection.Columns[4].Visible = false;
k.ravi sankar
|
|
|
|
|
1.Can anybody provide me the solution by Migration from Enterprise Library 1.1 to Enterprise Library 2.0 ?
2. How to use the replacement of EnterpriseLibrary.Configuration.dll in Enterprise Library 2.0 relating to the serialization and deserialisation issues of a particular class where the class information has to be stored in a different file ?
Suggestion of any document is also welcome
I need the solution urgently.
Thanks in advance.
satyen01
|
|
|
|
|
Since this is your first post I'll give you some help
Don't use Urgent in your subject line or anywhere in the text.
only two letters away from being an asset
|
|
|
|
|
Thanks for ur kind look.
satyen01
|
|
|
|
|
I'm wondering if anyone knows how to create/start an instance of a separate aspx or c# application on the server, read its output, and terminate it, all from inside of an asp.net instance... or, if such a thing is possible at all. My initial searches on google have been fruitless, and I was wondering if anyone has done something like this before and/or could link me to an article/documentation outlining some of the procedures.
-Reasons-
I've begun authoring to Microsoft Sharepoint 2007, which fully runs on asp.net 2.0. However, it has some limitations (probably for security purposes.) It seems to be completely lacking in support of DirectoryServices, and throws a very generic error ("An operations error occurred.") when you so much as run an LDAP query through System.DirectoryServices.DirectorySearcher.FindAll(). This (security feature?) can be completely avoided, if I can find a way to create then initialize an application to perform the basic AD query, and report back basic information.
Thanks a bunch!
-Roo
|
|
|
|
|
If you can run another web application then you can make a request to that from your code just as a use does. The System.Net.WebRequest (I think thats it) is probably your best bet, just give it the Url and params and it'll get you the response.
Thats the simple solution, to return a JSON string or CSV-like data from either an aspx page or a web service (ascx file), as if the code is a client browser making an Ajax request. Slightly more work but a better solution would be a 'proper' web service, where the calling code (inside Sharepoint) has a reference to the web service and uses it like any other class, no idea if you can do that with Sharepoint though but if you can there are tonnes of tutorials on web services out there.
|
|
|
|
|
dekart_roo wrote: create/start an instance of a separate aspx or c# application on the server, read its output, and terminate it,
Yes, it's called a web service
only two letters away from being an asset
|
|
|
|
|
Thanks,
I took a very quick glance at web services, and it looks to be just what I need. I appreciate the quick response! I'll go bury my nose in tutorials and documentation, and hopefully I'll have a working solution soon.
|
|
|
|
|
Hi G to URU's
I have a function which returns data table, amongst other functions I created this one returns a warning:
Warning 4 Function 'getSectionContent' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used.
Please Advice.
Thanks
Dom
Here's the function
Private Function getSectionContent() As DataTable
Dim con As New cls_Connection(enu_Databases.Customers)
Dim clsSelect As cmp_spSelectSectionContent = Nothing
_dt = New DataTable
Try
con.BeginTransaction()
clsSelect = New cmp_spSelectSectionContent(con.SQLConnection, con.SQLTransaction)
If Not clsSelect.fill(_courseSectionID, _dt) = True Then
Throw New Exception(clsSelect.ErrorMessage)
Else
con.CommitTransaction()
Return _dt
End If
Catch ex As Exception
con.RollbackTransaction()
Finally
con.Dispose()
End Try
End Function
|
|
|
|
|
Its pretty self-explanatory really, not all code paths inside that function will return a value. Your return statement is inside a try block, if that block throws an exception the return statement will never be reached. Its generally bad practice to put return statements half way through methods anyway, can cause maintenance nightmares. Also I don't think your finally code will ever run unless an exception is thrown. Put the return statement right at the end of the function.
|
|
|
|
|
Thanks badgrs,
I think I got your point, since its a function I still need to return something even when it hit exemption, I placed return nothing on catch statement, this way I could test if my datatable contains something or nothing at all.
Thanks for the help
Dom
Updated snips:
Private Function getSectionContent(Optional ByVal sectionContentID As Integer = 0) As DataTable
Dim con As New cls_Connection(enu_Databases.Customers)
Dim clsSelect As cmp_spSelectSectionContent = Nothing
_dt = New DataTable
Try
con.BeginTransaction()
clsSelect = New cmp_spSelectSectionContent(con.SQLConnection, con.SQLTransaction)
If Not clsSelect.fill(_courseSectionID, _dt) = True Then
Throw New Exception(clsSelect.ErrorMessage)
Else
con.CommitTransaction()
Return _dt
End If
Catch ex As Exception
con.RollbackTransaction()
Return Nothing
Finally
con.Dispose()
End Try
End Function
|
|
|
|
|
Why not just add the Return _dt to the end of the function, so if theres an exception you'll return an empty datatable rather than null. That would seem more logical to me.
|
|
|
|
|
badgrs wrote: Also I don't think your finally code will ever run unless an exception is thrown.
The code in the Finaly block will always run.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi,
can anyone tell me why this event doesn't fire?
Protected Sub cb_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cb.SelectedIndexChanged
'do somehting
End Sub
Thanks,
Martin
|
|
|
|
|
Not with just that code no. Perhaps your not actually changing a value? Is it set to autopostback? How do you know its not firing if theres no code in there? (or was that just for posting purposes?)
|
|
|
|
|
you have to need autopostback = true
Alpesh Dhanesha
alpesh dhanesha
|
|
|
|
|
I want to generate .aspx dynamically when user clicks a button
|
|
|
|
|
This seems like a crazy requirement and I can't see why you'd want to do this for any 'normal' application. Why? I would rethink the idea and find another way
|
|
|
|
|