|
Please check the closing braces properly.
eHTESHAM
|
|
|
|
|
hello all,
I made a web form, i put a button control on one of its forms, i want to get all of the client data such as: client's computer id, ip address, ......
how i can get these data??? need code f u can gys
Thanks alot
Hamody
|
|
|
|
|
Mohammad Daba`an wrote: ip address,
Context.Request.UserHostAddress
Mazy
"This chancy chancy chancy world."
|
|
|
|
|
You can use the Request object to get a decent amount of information from each user.
e.g.
C#
bool hasCookies = Page.Request.Browser.Cookies;
VB
Dim hasCookies as Boolean = Page.Request.Browser.Cookies
Hope this helps!
|
|
|
|
|
hi guys,
I made a webform and i use crystal reports, can i merge the cells of squential rows and columns, if yeah may any one send me a sample or the code to do this
Thanks alot
Hamody
|
|
|
|
|
hi friends,
I am using treeview control in C# i want to set some session and some little code on click of particular node how can i achieve this
regards jabbar
jabbarsb
|
|
|
|
|
Row_Updating not updating old value with new value
Pls how can i update the datatable with the newly entered values in the gridview? Also i want to disable the Keyfield, the first column from being edited by the user
See my code below
Protected Sub grdPhases_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles grdPhases.RowUpdating
If Not Session("biddetail") Is Nothing Then
oDT = Session("biddetail")
End If
grdPhases.DataSource = oDT
If e.NewValues("PhaseCost") IsNot Nothing Then
e.NewValues("PhaseCost") = Decimal.Parse(e.NewValues("PhaseCost").ToString(), Globalization.NumberStyles.Currency)
Else
lblPhaseCost.Visible = True
e.Cancel = True 'cancels the operation being performed
End If
If e.NewValues("StartDate") IsNot Nothing Then
lblPhaseCost.Visible = False
Else
lblPhaseCost.Text = "Enter the Start Date for this phase"
lblPhaseCost.Visible = True
e.Cancel = True 'cancels the operation being performed
End If
If e.NewValues("EndDate") IsNot Nothing Then
lblPhaseCost.Visible = False
Else
lblPhaseCost.Text = "Enter the End Date for this phase"
lblPhaseCost.Visible = True
e.Cancel = True 'cancels the operation being performed
End If
If Not IsDate(e.NewValues("StartDate")) Then
lblPhaseCost.Text = "Invalid Start Date"
lblPhaseCost.Visible = True
e.Cancel = True 'cancels the operation being performed
Else
lblPhaseCost.Visible = False
End If
If Not IsDate(e.NewValues("EndDate")) Then
lblPhaseCost.Text = "Invalid End Date"
lblPhaseCost.Visible = True
e.Cancel = True 'cancels the operation being performed
Else
lblPhaseCost.Visible = False
End If
'Dim strFind As String = "PhaseCode='" & e.OldValues("PhaseCode") & "'"
'Dim RowFound() As DataRow = oDT.Select(strFind)
'For j As Integer = 0 To RowFound.GetUpperBound(0)
'only 1 row
e.OldValues.Item("Description") = e.NewValues.Item("Description")
e.OldValues.Item("StartDate") = e.NewValues.Item("StartDate")
e.OldValues.Item("EndDate") = e.NewValues.Item("EndDate")
e.OldValues.Item("PhaseCost") = e.NewValues.Item("PhaseCost")
'Next
Session("biddetail") = oDT
'Set EditIndex=-1 to exit editing mode and rebind teh gridview to the
'datasourecto refersh
grdPhases.DataSource = oDT
grdPhases.EditIndex = -1
End Sub
t.aransiola
|
|
|
|
|
Row_Databound Event fire when i click Edit link on the gridview and not when grid is bound to my datatable. I am using a datatable returned by my middletier as a datasource to the gridview
In my Row_Databound, i have a function that gets the total of a numeric column. So when the form opens, the total did not show
t.aransiola
|
|
|
|
|
How can i increace session time for avoiding session expire.
One only darshan shah
|
|
|
|
|
In your web config file you can set the session to timeout longer then the default of 20 minutes:
<sessionState
mode="[Off|InProc|StateServer|SQLServer|Custom]"
timeout="number of minutes"
...
/>
If you have long running processes that you are trying to run in asp.net you will run into other problems as well. There is also a timeout for the iis worker process. So if you are doing some processing that takes a long time to run and doesn't return to the web page, you could run into this worker process timeout as well. You have to set this in the IIS configuration manager. If your app is a long running process, it might be a good idea to write a windows app instead so you don't run into timeout issues.
Hope that helps.
Ben
|
|
|
|
|
hi friends,
i m darshan.
I have one query.
I load one usercontrol on place holder.
And i put one button on usercontrol.
When i execute it and press the button which i placed on the usercontrol ,
it is not fired or it is not working..
And when i see the view source of the button , the name of the button is changed becoz i put the usercontrol on the place holder.
If i put use usercontrol directly then i can get the click event of the button.
But when i m put my user control on the place holder then i can not get the click event.
If anybody have solution for this query then pls reply immediately...
Darshan Shah
|
|
|
|
|
Hi Dharshan,
Can you please post your view source code so that we can help in someway??
I tried placing a usercontrol in the placeholder and publishing the website which is working fine without any issues, the button event is firing correctly...
Regards,
Sandeep Kumar.V
|
|
|
|
|
Hi,
I have a C#.net application in which i have read the datas from excel sheet and displayed in a datagrid in my Aspx form.
The code is here
private void Button2_Click(object sender, System.EventArgs e)
{
try
{
string strConnection = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Salary.xls;Extended Properties=""Excel 8.0;HDR=YES;""";
OleDbConnection conn = new OleDbConnection(strConnection);
//conn.Open();
OleDbCommand command = new OleDbCommand("SELECT * FROM [Sheet1$]", conn);
// command.Connection = conn;
// command.CommandType = CommandType.Text;
// command.CommandText = "SELECT * FROM [Sheet1]";
OleDbDataAdapter da = new OleDbDataAdapter(command);
DataSet ds = new DataSet();
//DataTable dt = new DataTable();
conn.Open();
da.Fill(ds, "EmpSal");
DataGrid1.DataSource=ds;
DataGrid1.DataBind();
//da.Fill(dt);
conn.Close();
lblError.Text="The Excel sheet has been read";
//return dt;
}
catch (Exception ex)
{
Response.Write( ex.Message);
//return null;
}
}
the thing is that i have to upload the datas into the mysql database table. can anybody pls help me with the C#.net code. i need to use only mysql database.(coz we r using mysql db in our project)
Regards
Vijay.
|
|
|
|
|
I m working in ASP.Net (1.0 Version ) in that i have problem
with reporting . Is there any better tool for reporting specially for Cross Tab Reports other than Crystal (Version 11.0)? In this Crystal Report, we are unable to make it in more customizable form like colors coombination for columns when particular condition is met.
|
|
|
|
|
image is stored in "C:\ms4w\apps\Dhanbad\map\map.PNG" this folder
now i want to give an option to the user ,so that they can download this map.png in their specified folder.
plz tell me the code
|
|
|
|
|
Just use an hyperlink with target as the path specified or use Response.Redirect(path).
|
|
|
|
|
Hi All,
I am developing a website using asp.net 2.0 and MSAccess.
it in under construction, but I want to test it.
It is for intranet purpose only,.
My application runs only when I open Visual Studio -> start debugging
If I stop debugging and close the Visual Studio, the browser shows "The page cannot be displayed".
How can I run it from another pc in my intranet ( for MSAccess as backend )
Any help is appreciated.
Thanks
Bye
Bajrang
Using .net 2.0 (VS2005)
|
|
|
|
|
Hi there,
You have to publish website in Build menu...
<< >>
|
|
|
|
|
salam,
I have a web page which have some field like first name ane lastname address etc that is save in a database table i have i also print button. I want when i will press the print button than a report generate and printer print the the report, without opening the print dialog.just i press the button and printer print the reports. i am wainting ur response.
suhail shahab
|
|
|
|
|
You can't.
Quite correctly, things are set up so that you, as a web programmer, can't do things on the user's machine without them allowong it - imagine if you could do what you want: you'd find web-pages suddenly sending out all sorts of nonsense to your printer - advertising gibberish, porn.. all sorts...
And anyway, the user may want to select print settings first - page size and type, draft or print mode etc
cheers
Fred
|
|
|
|
|
Hello All,
I'm getting the following error message in my ASP program.
Microsoft VBScript runtime error '800a0046'
Permission denied
/monthly/holdingsMD.asp, line 141
Previously this code is working fine on a different machine for years. Now we shifted this application to a new machine and got the above error message when we tried to insert some values from a file. The other pages in this application are working fine on the new machine (these pages are retrieving data from database.)
Here is the code were I’m getting the error message:
--------------------------------------------------------------------------------
set myfile=Server.CreateObject("scripting.filesystemobject")
Response.Write holdingspath &" "&mktdatapath& "transaction updated "
'******** Inserting Market data into tbl_mktdata **********
if mktdatapath <> "null" then
'mktdatapath="f:\monthly reports\holdings\01062006.MD" 'Server.MapPath()
set genfile = myfile.OpenTextFile(mktdatapath,1) -->This is line 141
ObjCon.Execute "delete from tbl_mktdata" 'delete previous contents from tbl_mktdata
--------------------------------------------------------------------------------
FYI: This application is running on our local system. With Windows XP Prof. And IIS configured.
Please let me know what is the possible reason for this error.
Many Thanks!!
Jagadeesh
hai all please clarify mny doubts
|
|
|
|
|
As it says: "Permission denied" - You need to get in touch with the administrator of that machine and ask him/her to give your application WRITE permissions on the folder where the files are that you want to write to.
cheers
Fred
|
|
|
|
|
Hi Fred,
The folder, in which the files were there, has all permissions granted to the user . (The user is having full control over the folder.) But still I’m getting the error message.
Please help me; your feedback is greatly appreciated.
Many Thanks!!
Jagadeesh
hi all please clarify my doubts
|
|
|
|
|
You have commented out this line:
'mktdatapath="f:\monthly reports\holdings\01062006.MD" 'Server.MapPath()
So where is the line where mktdatapath is set? Perhaps you have a) not set it at all or b) left it hard-coded pointing to your local machines path.
F
|
|
|
|
|
Fred,
That line of code was commented out.
Here is the full code we are using.
'*********************************** Inserting Market data into tbl_mktdata **************************
if mktdatapath <> "null" then
'mktdatapath="f:\monthly reports\holdings\01062006.MD" 'Server.MapPath()
set genfile = myfile.OpenTextFile(mktdatapath,1)
ObjCon.Execute "delete from tbl_mktdata" 'delete previous contents from tbl_mktdata
response.Write("Clear previous market data in tbl_mktdata <br>")
while not genfile.AtEndofStream
filecontent = genfile.readline
filearray= split(filecontent,",")
'Response.Write filearray(1) & " "&filearray(7) & "<br>"
'insert data into tbl_mktdata file
ObjCon.Execute "insert into tbl_mktdata values ('"&trim(filearray(1))&"',"&cdbl(filearray(7))&")"
wend
response.Write("end of market data<br>")
'' end of market data
else
Response.Write "<table align=center><tr><td height=250><font face=verdana size=2 color=red><b>No Market data File input</b></font></td></tr></table>"
Response.End
end if
'*********************************** End of Inserting Market data ************************************
~Jagadeesh
hi all please clarify my doubts
|
|
|
|