|
Hi
try this
string url=HttpContext.Current.Server.MapPath("xmlNames.xml");
smiles
shema
|
|
|
|
|
i have the following code and its giving me the following error:
Cannot find column 1.
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.IndexOutOfRangeException: Cannot find column 1.
** code below **
Function getCountryLocations() As DataView
'get all country Locations based on ID you supply
Dim ds As New DataSet
Dim dv As New DataView
Dim kount As Integer
Dim lid, lname As String
Dim newrow As DataRowView
objL.locationID = CType(38, Integer)
ds = objL.getCountryLocations(objL)
dv = ds.Tables(0).DefaultView
newrow = dv.AddNew()
newrow(0) = CType(objgen.getDefaultlocationsID, Integer)
newrow(1) = CType(objgen.getDefaultlocationsID, Integer)
newrow(2) = "All Locations"
kount = 0
Dim dsn As New DataSet
Dim cond As SqlCommand
Dim adpt As SqlDataAdapter
Dim conn As SqlConnection = New SqlConnection(Global.connect)
Try
conn.Open()
While kount < dv.Count
Dim r As DataRow = dv(kount).Row
lid = r("Location_ID")
' Dim sql As String = "SELECT * FROM zimg_Ads where LocationID =" & lid & "and status=1"
'cond = New SqlCommand(sql, conn)
'adpt = New SqlDataAdapter(cond)
'adpt.Fill(dsn)
objL.locationID = CType(lid, Integer)
dsn = objL.getAdsinLocation(objL)
'Dim dvn As New DataView
'dvn = dsn.Tables(0).DefaultView
lname = r.Item("LocationName")
If lid = 11 Then
lname = lname
Else
If CType(dsn.Tables(0).Rows(0).Item("Ctr"), Integer) = 0 Then
dv.Delete(kount)
Else
lname = lname & "(" & CType(dsn.Tables(0).Rows(0).Item("Ctr"), String) & ")"
r.Item("locationName") = lname
End If
End If
kount = kount + 1
End While
Catch ex As Exception
Finally
conn.Close()
conn.Dispose()
End Try
Return dv
End Function
Private Sub ddlCountry_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
'get all locations for a spec country
bindCountryLocations()
End Sub
philpetszw
|
|
|
|
|
You might want to double check the schema of the data table before setting the column value for the new row.
|
|
|
|
|
i solved the problem, thanks for your insight. the stored procedure i had was returning a single column from the database. i changed it to retrieve all the columns using a select * statement
philpetszw
|
|
|
|
|
Hi,
Is there any way to protect my ASP.Net code before installing it ?
The novice.
|
|
|
|
|
|
Hi
I P.Ramakrishna,SoftwareTrainee in ResonanaceHoldings company.I want best websites to learn ASP.NET COMPLETELY.please send .........
|
|
|
|
|
|
I am using external tool for creating menu.
But It allows me to open a URL only on click of that menu.
I want to make visible a table on click of that menu.
How to Do This ?
|
|
|
|
|
Can you not just set a javascript call to a function instead of a url?
Something like:
javascript:ShowTable();
and then in that function set the visibility of the table.
|
|
|
|
|
Hi,
I have a page that calls a sql procedure and it runs for 20 - 40 min. I use usual threading for this page.
Thread objthread = new Thread(new ThreadStart(ticketingThread));<br />
objthread.Start();
As i dont know when it will end. i never abort the thread. what happens is when user uses the page for 1 weeek, the page starts hanging. I dont know what happens. When i tried debugging it works fine.
I also saw creating thread in threadpools
ThreadPool.QueueUserWorkItem(new WaitCallback(ticketingThread));
Please advise which one i have to follow and what is the difference between the two.
Thanks
Venky
|
|
|
|
|
Hi Venky.
I have nothing to hand here, but i remember that you can use a delegate to run the thread, and then a callback function which will terminate it.
Im not sure how often this thread is getting created, but even if it is only once, it is good practice to terminate the thread when it has completed its job.
Cheers
Mark.
|
|
|
|
|
I have asp.net page for user login, after login they can sign out before exit page, but if they not click logout, the machine will remember his/her ID?
................
|
|
|
|
|
At the LOGIN save the user id in session e.g Session["UserId"] = userid.Text and on button click of logout clear the Session value. What will happen is if he doesnt press the logout button the value stays stored otherwise it will be cleared.
So u can use this value the next time he/she logs in.
Hope I helped
If only they could see what I see in my mind
|
|
|
|
|
I still can not get it, i mean if he does not click button logout, when other user open web as computer is will dispaly old user
................
|
|
|
|
|
The server will close automatically any session after 20 minutes of inaticity.
you can modify this parameter (20 min) in your Web.config file.
or by using the command "Session.timeout = 44;" (44 minutes for exp).
To clear all Session variables => "Session.Clear();"
Regards
The novice.
|
|
|
|
|
Thank for for helped me.
................
|
|
|
|
|
Sorry I didnt understand the problem if what novice said helped u then I misinterpreted ur prob
If only they could see what I see in my mind
|
|
|
|
|
In web application , the controls displaying the old values which are previous entered in a drop down list. In my application i need to clear off those values. Whether it's possible. If so, please help me.
Regards
Ravi
|
|
|
|
|
try being more descriptive, however u can use
ddlname.Items.Clear();
to clear the values and can populate the ddl again.
Hope I helped
If only they could see what I see in my mind
|
|
|
|
|
Its not a list/drop down control. Its a text box control where previously entered values will be displaying. I dont want to display those values for others. For example while logging into a mail Id if any emailid exists with that letter those list of values will be shown as a drop down list.
I hope you have understand what i mean to say.
Thanks for the help
Ravi
|
|
|
|
|
b ravi kumar wrote: Its a text box control where previously entered values will be displaying. I dont want to display those values for others
yourtextBox.Text = "";
Hope I answered your question.
If not, please clarify
Sincerely,
Elina
Life is great!!!
Enjoy every moment of it!
|
|
|
|
|
Hai,
I need to store 3 excel files (data) in a database (sql server) using asp.net. So, that whenever i need i should recall it. Can i store each file as an object. If so, just guide me. In each excel file it consist 5 sheets.
Regards,
Ravi
|
|
|
|
|
HI all
I am displaying images from FTP server in a Datagrid(Image name and Image)
When user click selected Image name it will download
Now I want to give code to only once the user download that file after that the image will Inactivate.
Like When we recive a new Mail it will in bold letters after opening the mail that will inactivate.
How can i write code for this Plz
Can any one help me iam using 1.1 ver
THX
asdfasdfasdfasdfasdfasdfasdfasdfasdfasdf
|
|
|
|
|
(Simply I want to use scanner in client side in DMS (Document Management System) web application. I have searched the Internet for solution but I found it very expensive for me, then I found small program wreten By Taha Zayed it works fine but when it coms to saving the image it did'nt save it in any where on the PC.
Thanks
Ghannam
GH
|
|
|
|