|
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
|
|
|
|
|
|
Who says this is not possible, cant we generate any file during runtime and than save to specific folder
Stop replying fooling Ans.
Hello Forum
Always be in touch to help about the topic ASP.NET
|
|
|
|
|
Let's hear your solution then. I'll look forward to the article.
only two letters away from being an asset
|
|
|
|
|
I'm using the following code to allow a user to download a file from a webserver:
Response.AppendHeader("content-disposition", "attachment; filename=" + name)
If ftype <> "" Then
Response.ContentType = ftype
End If
Response.WriteFile(fullpath)
Response.End()
When the code runs the browser will display the Save file dialog box. How can I tell if the user click the Cancel button on this dialog box?
|
|
|
|
|
Hello coders,
Can u please help me in implementing the "Add to shopping cart" concept with secure method in asp.net
Hello Forum
Always be in touch to help about the topic ASP.NET
|
|
|
|
|
|
I am working with Asp.net 2.0, I was trying to use FieldmapCollection which is object present in Asp.net 1.1 framework and does not present on Asp.net 2.0
please help me out if there is any alternate for FieldMapCollection in Asp.net framework 2.0. For your information I will paste the part of code where I use FieldMapCollection,
Dim redValues As Double() = {10, 12, 8}
Dim redXValues As Double() = {1, 2, 4}
Dim blueValues As Double() = {6, 14, 9}
Dim blueXValues As Double() = {1, 3, 5}
Dim listOfArrays As ArrayList = New ArrayList()
listOfArrays.Add(redValues)
listOfArrays.Add(redXValues)
listOfArrays.Add(blueValues)
listOfArrays.Add(blueXValues)
Dim lstProvider2 As New SoftwareFX.ChartFX.Data.ListProvider(listOfArrays)
Dim fields As FieldMapCollection = Chart1.DataSourceSettings.feilds
fields.Clear()
fields.Add(New FieldMap("Field1", FieldUsage.Value))
fields.Add(New FieldMap("Field2", FieldUsage.XValue))
fields.Add(New FieldMap("Field3", FieldUsage.Value))
fields.Add(New FieldMap("Field4", FieldUsage.XValue))
Chart1.Gallery = Gallery.Lines
Chart1.DataSource = lstProvider2
Thanks in advance
-- modified at 9:58 Friday 22nd June, 2007
|
|
|
|
|
Delete your previous post. Asking the question once is enough.
only two letters away from being an asset
|
|
|
|
|
hi,
in my project i using this code for get rss feed data
DataSet ds = new DataSet();
Line 37: ds.ReadXml("http://feeds.autoblog.com/weblogsinc/autoblog");
Line 38: GridView1.DataSource = ds;
Line 39: GridView1.DataBind();
i am getting the below error:
Server Error in '/Slideshow' Application.
--------------------------------------------------------------------------------
A column named 'link' already belongs to this DataTable: cannot set a nested table name to the same name.
Please help me
Ramesh
|
|
|
|
|
Might be XMl file is not valid contains sub double value that you are assinging to Gridview again Check by debugging the application
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
|
try this code
XmlDataDocument xdoc = new XmlDataDocument();<br />
XmlTextReader Reader = new XmlTextReader("http://feeds.autoblog.com/weblogsinc/autoblog");<br />
xdoc.DataSet.ReadXml(Reader, XmlReadMode.InferSchema);
GOD HELP THOSE WHO HELP THEMSELVES
|
|
|
|
|
hi Pathan,
Thanks for taking interest on my query.
but i am getting the same error
i think problem with DataSet is not reading the data.
Server Error in '/Slideshow' Application.
--------------------------------------------------------------------------------
A column named 'link' already belongs to this DataTable: cannot set a nested table name to the same name.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.DuplicateNameException: A column named 'link' already belongs to this DataTable: cannot set a nested table name to the same name.
Source Error:
Line 42: XmlDataDocument xdoc = new XmlDataDocument();
Line 43: XmlTextReader Reader = new XmlTextReader("http://feeds.autoblog.com/weblogsinc/autoblog");
Line 44: xdoc.DataSet.ReadXml(Reader, XmlReadMode.InferSchema);
Line 45:
Line 46:
Ramesh
|
|
|
|
|
Hi,
I have created a website which will automatically refresh every 15 minutes. The website will have like 5 users logged in to the site all the day. It will work fine for 8-10 hours and sometimes the whole day. But when I return in the morning I will have the error message dispalyed on the screen that says Validation of viewstate MAC failed. I turned off the validation in the web.config but still it is giving the same error. Please let me know the solution.
THanks,
sridhar.
|
|
|
|
|
|
I have tried the suggestions that they have mentioned in the forums. I disabled the event validation in the web.config but still it is giving the error.
|
|
|
|
|
Hello Guys,
Can any one of you help me in passing stored procedure values to FormView --> ItemTemplate -->
I am unable to understand how to pass the values to PhotoID. Plz Help its an urgent task.
Regards,
dhulipudi
|
|
|
|