|
This is just a guess, but have you tried a UNC path? e.g. \\HostingServer\CDrive\Invoice\myData.mdf
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|
|
Hi all,
How can Read the Error Line number from an Exception without using ex.message.substring.
Thanks
Dana
|
|
|
|
|
AFIK its a single string not a collection of strings like ina textbox so you can't read the line number.
|
|
|
|
|
Hi,
for Exception exc:
1. exc.Message does not contain a line number
2. exc.StackTrace contains a multi-line string with the stack trace, which may or may not
contain linenumbers (depends on where the problem is, the amount of debug info available)
3. may have an inner exception where the actual problem occured
4. exc.ToString() returns a string that contains all available information, including the
info on inner exceptions
If you want to extract a line number, you will need to perform string operations,
such as IndexOf() and SubString().
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Hi,
Can we have a common exception handler for any error accured in any form?
Just like we have in asp.net i.e. Global.asax, in that we can write common code for any error that accurs through out application.
Help me out.
Thank you.
|
|
|
|
|
Yes, I wrote my own error handler which when my program captures an exception, I then pass it to my Exception handling class, which includes the option to email details of the exception as well as present a friendly message to the user.
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|
|
Take a look at the ApplicationDomain.UnhandledException event.
|
|
|
|
|
As long as you're using this just for display purposes, it's OK to do. Realistically, you should catch the error as close to the possible source as possible so it can be properly handled (cleanup, retries, etc.) since that's the only place where you will actually have any meaningful context around the error. Don't use a global exception handler like this for anything other than unhandled exceptions.
Scott.
—In just two days, tomorrow will be yesterday.
—Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[ Forum Guidelines] [ Articles] [ Blog]
|
|
|
|
|
I am developing an application using VB.Net. There are two pages in my application:
1. First page is a search results page.Search result is displayed in a grid. First column of the grid is User Id which is a linkbutton. On click of some User Id it will redirect to selected user details page.
2. Selected Users Details page is second page. This page contains 5 tabs. Body of each tab contains a link called Back to Search Results.
On click of this link i want to redirect to search results page. Search results should be displayed without hitting the server again.
Please help me to solve this problem using javascript or vb.net code...
|
|
|
|
|
Hii ,
How can we disable the sort feature in datagridview in windows application or the functionality shouldnot work at runtime ?
How can we hide the edit icon on Row header -> ????
How to hide the * at design time of datagridview ??
Thanks & Regards ,
|
|
|
|
|
Disable the sort feature as follows:
<br />
For u = 0 To 11 'number of columns<br />
DataGridView1.Columns(u).SortMode = DataGridViewColumnSortMode.NotSortable<br />
Next u<br />
With regard to questions 2 & 3:
Set all 'AllowUser'-functions in the properties window to False.
Good luck.
|
|
|
|
|
hi all
i m working on a richtextbox. let me explain my problem
the richtextbox contains some text. now i create a form that provides printing facility to print the contents of richtextbox (i have certain reason of doing so.)
when it comes to provide the page range (page to - from) how can i handle that. i tried to control it by properties but it shows the wrong printing result. how can i determine the total pages, (some how i manages to get this) but the page range is a problem to me.
can some one guide me
thanks in advance.
help everyone
Falling down is not defeat...defeat is when u refuse to get up...
|
|
|
|
|
I have created a project which has one control which accepts certain media files like .mpg, .avi, .pps (power point viewer), .swf (Flash file), .jpg etc.
Now what happens is once I run that executable (my project) and browse certain file and open them.
After that for all those files, which I had opened, default application was set my project executable.
Means when I directly open .pps file, my project executable is get opened.
I think my project has set certain attain attribute/settings in windows.
Anyone has any idea to remove this settings?
Thank you
|
|
|
|
|
Hi!
I am populating a treeview on fly from DB on pageload. the treeview looks like
Motor
|
|-Holden
| |
| |-Astra
|
|-Subaru
the treeview is dynamic. I want to maintain the selected node when i navigate away from one page to another. If i select "Astra" in page 'A' and do postback it maintains the selected state using session("selected") = tv.selectednode.valuepath
but, if navigate to page 'B' in page load in my below line
If Not Session("selected") Is Nothing then
debug.writeline(Session("selected")) -->prints 118/115
propertytn = Me.tvProperty.FindNode(Session("selected")) --->nothing
propertytn.selected = true
i get null reference when i try to find that node and select it.
I spend few days trying to figure out, posted everywhere but no one is giving me satisfactory reply
somewhere i read i should expand parent first before expanding child. but again how would i expand all the parents if the selected node is in 6th level in a treeview.
please help.
|
|
|
|
|
If you are getting node returned from FoundNode you may have an EnsureVisible (it's on some winform controls).
If this is not available then you should be able to work with the foundnodes parent node, walking up the tree till you get to the root node, expanding at each step.
If you can't expand from the bottom then put each node into an array of node and when you reach the root node you have a list of nodes to expand from the top.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi!
thanks for reply. I think the node becomes only available when I drilldown (by the look of my code). i.e it has treenodes populateondemand. could you possibly point out what i am doing wrong to acheive my goal. am i populating the treeview incorrectly? please help
brief code as below
sub page_load
if not ispostback then
PopulatePropertyLocation()
end if
If Not Session("selected") Is Nothing then
debug.writeline(Session("selected")) -->prints 118/115
propertytn = Me.tvProperty.FindNode(Session("selected")) --->nothing
propertytn.selected = true
end sub
----------------------------
Private Sub PopulatePropertyLocation()
Dim myDal As New clsDAL
Dim dt As DataTable
Try
dt = myDal.getPropertyLocation(userId, tLocId)
PopulatePropertyLocationNodes(dt, tvProperty.Nodes)
Catch ee As Exception
Throw ee
myDal.UpdateErrorLog(ee.Message, ee.TargetSite.Name.ToString())
End Try
End Sub
Private Sub PopulatePropertyLocationNodes(ByVal dt As DataTable, ByVal nodes As TreeNodeCollection)
For Each dr As DataRow In dt.Rows
Dim tn As New TreeNode()
tn.Text = dr("LName").ToString()
tn.Value = dr("LId").ToString()
nodes.Add(tn)
'If node has child nodes, then enable on-demand populating
tn.PopulateOnDemand = (CInt(dr("LocationCount")) &gt; 0)
Next
End Sub
many thanks in forward.
|
|
|
|
|
|
I used the dataTable.Select method to get a single row from a dataTable. Now I need to get the value from the stud_id column in the dataRow. I tried to do the following and I get the blue Line under
foundRow("stud_id").
intStudID = foundRows("stud_id") ' this line of code did not work, why?
How do I get the value of the stud_id column in the dataRow.
Here is my code.
' global variable declaration<br />
' create dataRows<br />
Dim foundRows() As Data.DataRow<br />
<br />
' a part fo the code in sub procedure<br />
Call GetRowsByFilter("tbl_lessons", "less_time = " & startTime & "AND less_day = " & arrDayNum(intArrCount))<br />
<br />
<br />
Private Sub GetRowsByFilter(ByVal tableName As String, ByVal exp As String)<br />
Dim dt As DataTable = lpDataSet.Tables(tableName)<br />
<br />
' Use the Select method to find all rows matching the filter.<br />
foundRows = dt.Select(exp)<br />
<br />
End Sub
|
|
|
|
|
AAGTHosting wrote: foundRows("stud_id")
This is an array of rows and you are defining the row number as "Stud_id", try
foundRows(0)("stud_id")
This will get you the first row (0) and the column ()("stud_id")
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I am having an issue that seems to be specific to a single input source. I select a group of rows from a table and based on some matching determine that they are duplicates for my purpose. I fill an arraylist with the actual datarows and then after I am finished with all of the logic of determining the duplicates, I remove them like this.
For Each duplicateRowToRemove As DataRow In rowsToRemove<br />
duplicateTable.Rows.Remove(duplicateRowToRemove)<br />
End If<br />
Next
I receive the RowNotInTableException or some version of an IndexOutOfRange exception everytime. I have tried adding a primary key by just incrementing a counter and inserting it in the "ID" column, I have tried to check whether a row exists in the arraylist before adding it, I have tried to check to see if the row exists before removing it and nothing works. What am I missing here? This code has been in place for 4 months with no issues until today's input source (file) came in.
FYI - I can still run previous files but this one keeps causing the process to exception out.
CleaKO
"Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)
|
|
|
|
|
You should not attempt to remove items from a collection when performing a For Each through the same collection. Use a For loop to traverse the collection in reverse order, removing the items as you go.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
|
Have you tried usong the almighty Google[^]? 536,000 results to do what you are asking, in 5 seconds
I'm going to become rich when I create a device that allows me to punch people in the face over the internet.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
|
|
|
|
|
I tried using Google but i didn't get the required solution for my problem.
If u know the solution u answer it instead of criticizing
|
|
|
|
|
Jeminwins wrote: I tried using Google but i didn't get the required solution for my problem.
Ok. You will rarely find the "required solution" for your "problem." That is part of being a developer. You need to be able to do the necessary research for your project, and then apply what you learned to your project and tailor it to meet your needs.
Jeminwins wrote: If u know the solution u answer it instead of criticizing
Don't tell me what to do. I'm not going to answer a damn thing for you. I wasn't criticizing you. I simply told you to look on google, because there were thousands of articles that you could have read, learned from, and applied to your project. Instead of doing that, you came to code project and listed your requirement and expected someone to do your work for you. There wasn't even a question in your original post to answer. This isn't rent-a-coder. Do the damn research yourself, and when you get stuck at a specific spot, you can ask a specific question.
What have you tried to do to solve that solution, huh? Maybe barely search google for your exact solution, with full source code? Go to every forum you could think of and list your requirement, with no questions, and expect someone to waste their time doing your work? We help for free, when we feel like it. Why would someone help you, when you probably haven't tried to solve the problem yourself. Lazy ass Indian. That is why Indians get such a bad rep. People like you. You act like everyone owes you something. You believe we should do your work, research, and write code for you. You lazy ass. I can't believe people like yourself call yourself a developer.
I'm going to become rich when I create a device that allows me to punch people in the face over the internet.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
|
|
|
|