|
Well in order to find your problem, you have to track it down first.
My previous post suggested using the Try Catch and check for any exceptions thrown.
So you have to walk the code line by line using F5 debug and check for an exception.
As far as modifying the code, instead of a large block of code, you want to break the code down into a couple of reusable function.
I like taking all the database calls, and placing them in several separate functions.
Sort of like having a Data Access Layer, and Business Logic Layer, in which the 2 are separated.
Then it's easier to just go the suspected function and debug it, saves time in the long run.
But that's another subject.
Like I said, your connection may not be closing after and error, and your opening a new one over and over, causing a stall in execution.
|
|
|
|
|
Dear Sir, Thanks for your time and response , I have used seperate function and while debugging it does not show any error and after the end sub of the function it struck in loop and if i insert smaller records like 2-3 villages just it works fine ..
Again Thanks
|
|
|
|
|
Go through it with a fine tooth comb and keep checking
Here's an error I overlooked, the checkbox is boolean true or false, so it wrote an bit to the parameter of 0 or 1
Or perhaps it's a dropdown list since you used selected value.
.Add("@DistrictId", SqlDbType.TinyInt).Value = CheckBoxList1.SelectedValue
That's a lot data to insert all at once. You know that data writes and updates take longer to perform on the SQL server, in terms of time. And then you called a stored procedure after that.
You have an error somewhere. finding the error is easier if your code is more organized.
Maybe instead of so many partial writes, you gather all your data first, and package it up in a class, structure or model, and then do 1 write to the database. You just pass the class or structure to the database function, and do the write. On multiple records, you just loop the database write function.
https://msdn.microsoft.com/en-us/library/aa289521%28v=vs.71%29.aspx[^]
http://www.functionx.com/visualbasic/Lesson19.htm[^]
In a seperate file
Public Structure structure_accountInfo
Public m_firstName as string
Public m_lastName as string
End Structure
In a seperate file
Public Shared Function account_db_update(ByVal sAI as structure_accountInfo) as Integer
Dim dwExitCode As Integer = 2
Dim connStr As String = ConfigurationManager.ConnectionStrings("DefaultConnection").ConnectionString
Dim conn As New SqlConnection(connStr)
Dim query as string = _
"UPDATE TABLE " & _
" SET " & _
" firstName = @firstName " & _
", lastName = @lastName " & _
" WHERE ID = @ID "
Dim cmd As New SqlCommand(query, conn)
Dim param__FirstName As SqlParameter
param__FirstName = New SqlParameter("@FirstName", SqlDbType.VarChar, 80)
param__FirstName.Value = sAI.m_firstName
cmd.Parameters.Add(param__FirstName)
Dim param__LastName As SqlParameter
param__LastName = New SqlParameter("@LastName", SqlDbType.VarChar, 80)
param__LastName.Value = sAI.m_lastName
cmd.Parameters.Add(param__LastName)
Try
conn.Open()
cmd.ExecuteNonQuery();
dwExitCode = 0
Catch ex As Exception
dwExitCode = 1
Finally
conn.Close()
conn = Nothing
cmd = Nothing
End Try
return dwExitCode
End Function
In a seperate file
Dim sAI as new structure_accountInfo()
sAI.m_firstName = txt_firstName.text.trim
sai,m_lastName = txt_lastName.Trim
account_db_update(sAI)
You have so much code in the first example, I can't help you isolate your error until you isolate it down to a more narrow focus.
|
|
|
|
|
Hi,
I am facing some issue with my gridview. I have a webform with 1 button, 5 textbox (2 with date picker) and 1 dropdown list. The issue is when I perform search operation based on these controls texts, for few click on button I get the required data displayed on gridview but after few click it stop displaying that data. any solution to this.
P.S: VS 2013 framework 4.5, asp.net
|
|
|
|
|
Need more info. No one can help without seeing relevant code and without a clear description of the issue.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
What do you mean bu stop displaying? Have you checked it may be reset in response to any postback. But anyways will try to help if you elaborate more.
modified 20-Sep-20 21:01pm.
|
|
|
|
|
When I perform couple of search operation using some combination it is working fine after that the grid view is displaying no data. and no there is no postback data
|
|
|
|
|
Are you binding data back to gridview control after you received your search results?
If you add your code it may help to find the issue, we cannot figure out it without code.
modified 20-Sep-20 21:01pm.
|
|
|
|
|
I just keep getting a message about
"Over the last 24 hours, Googlebot encountered 1 errors while attempting to access your robots.txt. To ensure that we didn't crawl any pages listed in that file, we postponed our crawl. Your site's overall robots.txt error rate is 100.0%. You can see more details about these errors in Webmaster Tools. "
but our web site has no robots.txt file and our web site address is www.bba-reman.com please guide me how to get rid of this problem. thanks
tbhattacharjee
|
|
|
|
|
Try adding an empty robots.txt file to the root of your site.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Ignore it.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Hello,
I have a task to read a excel file using asp.net. My problem is that I have excel file containing text in different fonts like some text in "Times New Roman" and some text in "Shri Dev 078e". I didn't get any solution how to achieve the desire result. Example the below text:
eãX "OFFICES" Ho$ Ajam| H$mo AbJ-AbJ {H$VZo VarH$m| go gOm`m Om gH$Vm h¡?
In the above text containing font "SHREE-DEV-0708E" as well as "OFFICES" in Times new roman.
when i store that text in my db i have to store the text with font name as well.
Is their any logic to put some kind of special character within start and end of the word which is in different font.
|
|
|
|
|
Font information is stored separately from the actual characters, so you need to add some extra field to your database records to hold the information.
|
|
|
|
|
Thanks Richard MacCutchan,
I already have column in my database, but i am not able to track the font name from cell. if you have any code or some logic than you must let me know.
|
|
|
|
|
|
Doing some discovery work related to taking a 8 year old ASP, accessDB application and rehosting to a cloud VM (current app is running on a backserver behind a firewall and don't have access). My basic question is what are the key attributes I need to know in order to rehost the application. I understand the basic questions (ASP version, memory req, etc) but would like some input on other information I need to know so I can configure the new environment and have the application run. I have very little information related to the Apps user interface, business logic and data source connections other than it is ASP/Access with some SQL. Any input would be helpful. Thanks...
|
|
|
|
|
I remember back in the day 2003, most of those asp classic websites were pretty small in size, and had a database file, usually a MDF file located someone in one of the folders. They used a ADO adapter to talk to the file.
They were easy to setup, just copy the project into a folder, setup IIS server 4 or 5, point it to the website and go.
The database file location was hard coded into the code, so you may need to adjust it.
they were developed on Windows XP, and used Server 2003 to host them.
A gig of ram should do it.
Just create a Server 2003 virtual machine, copy the project into a dedicated hard drive with a root folder of
www\new website
and give it a run. You may need to fix some data paths in the code.
|
|
|
|
|
Thanks for the input... Do you have a suggested SDK that is best suited for this code base. I finally received the source code it was sitting on a back server... And I setup a web server but the code is hanging straight away. I need to put a dev and deployment env together to reverse engineer this beast....source dates back to 2003.
|
|
|
|
|
You just copy the folder and put it in your projects folder for Visual Studio, and load the web project.
There should be a set of config and project files for Visual Studio to just pick it up and go.
If not, you have to build a new project.
I'm trying to remember what I used back in 2003 to make classic asp websites.
Your probably going to have to load in up in a virtual machine on your desktop using Windows XP to run it.
Maybe not!
I used "asp classic websites, visual studio 2013" as search words to use Visual Studio 2013 Community Edition to work on the project using a Windows 8.1 Machine.
http://stackoverflow.com/questions/5125505/create-classic-asp-project-in-visual-studio-2010-from-scratch[^]
http://weblogs.asp.net/dixin/debugging-classic-asp-with-visual-studio-2013[^]
I have a friend at the bowling alley that still works in classic asp projects in VS 2013. I'll ask him tomorrow night about it.
|
|
|
|
|
Hi,
I am asking one question that How to bind loop inside the Data Grid View?
Reply Soon,
Thanks,
|
|
|
|
|
What does this mean? "bind loop?"
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Well we cannot bind loop to any control, but do you mean either interate DataGridView content as loop or bind DataGridView control inside any loop.
Please elaborate more.
modified 20-Sep-20 21:01pm.
|
|
|
|
|
In VS 2013, it is a real headache just to get the WAT running. After hours of mucking around I finally got it to pop up. But in Firefox, as soon as it opens, even if you immediately click security tab, it is already timed out. >:
In IE I get an error message that looks like it's not happy with a directory path.
I have not been able to figure out how to fix this in either browser. Anyone have any experience with this problem?
Thanks guys.
bmpds
|
|
|
|
|
What is WAT?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|