|
Hi, I created an asp.net web application using Visual Studio 2005. The problem is that when I run the application, the web page opens with the url: http://localhost:1158/MyProject/WebPage1.aspx...but I want it to open with http://localhost/MyProject/WebPage1.aspx. How can I fix that??
|
|
|
|
|
|
I have a textbox which represent date, but sometime it will be empty.I want to send it as empty to the database. How can I do it
|
|
|
|
|
If the string is empty, pass DBNull.Value and make the column nullable in the DB.
Use DateTime.TryParse to make sure the string you're passed in is a valid date. The other option is to store it as a string, but of course you can't do anything with it, then.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Another option would be to store a default date which is meaningless but avoids a null value in the DB (something I try to avoid if at all possible).
e.g 01/01/1900
|
|
|
|
|
How to make Asynchronous calls B/W two .NET objects
Sathiya
|
|
|
|
|
Depends, what sort of objects are you talking about ? If you mean two classes, then just set the call up to happen on another thread.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
How manys are there totally to use such Asynchronous calls
Sathiya
|
|
|
|
|
Hi, there's this website that is created in coldFusion and I want to add a LinkButton that opens an asp.net page, this page resides on my computer (localhost). How can I add the page to this other server that hosts the rest of the coldfusion pages?? What are the procedures to do that?
|
|
|
|
|
Just have it redirect to the right URL.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hey all,
What is up with my code here that is generating this error?
using System;<br />
using System.Data;<br />
using System.Configuration;<br />
using System.Collections;<br />
using System.Web;<br />
using System.Web.Security;<br />
using System.Web.UI;<br />
using System.Web.UI.WebControls;<br />
using System.Web.UI.WebControls.WebParts;<br />
using System.Web.UI.HtmlControls;<br />
using System.Data.SqlClient;<br />
<br />
<br />
class SqlConnectionDemo<br />
{<br />
static void Main()<br />
{<br />
SqlConnection conn = new SqlConnection("Data Source=;Initial Catalog=SupportIIS;User ID=sa ;Password=password");<br />
<br />
SqlDataReader SupportIIS_rdr = null; <br />
<br />
try<br />
{<br />
conn.Open();<br />
<br />
SqlCommand cmd = new SqlCommand("select * from ", conn);<br />
<br />
SqlCommand cmd = new SqlCommand("select CategoryName from SupportIIS", conn);<br />
<br />
SqlDataReader SupportIIS_rdr = cmd.ExecuteReader();<br />
<br />
<br />
SupportIIS_rdr = cmd.ExecuteReader();<br />
<br />
while (SupportIIS_rdr.Read())<br />
{<br />
string categories1 = (string)SupportIIS_rdr["Categories"];<br />
string MonthYear1 = (string)SupportIIS_rdr["MonthYear"];<br />
string repeatCall1 = (string)SupportIIS_rdr["repeatCall"];<br />
<br />
Console.Write("{0,-25}", categories1);<br />
Console.Write("{0,-20}", MonthYear1);<br />
Console.Write("{0,-25}", repeatCall1);<br />
Console.WriteLine();<br />
}}<br />
finally<br />
{<br />
if (SupportIIS_rdr != null)<br />
{<br />
SupportIIS_rdr.Close();<br />
}<br />
<br />
if (conn != null)<br />
{<br />
conn.Close();<br />
}<br />
}}<br />
}<br />
}<br />
}<br />
Error is the following:
Error 1 Type or namespace definition, or end-of-file expected c:\inetpub\wwwroot\SQLConnectionTest\SQLConnection.aspx.cs 75 3 http:
Any idea?
Thnx
|
|
|
|
|
Speaking as a VB programmer (yay!) ... doesn't seem to me as though your }'s match your {'s... and doesn't a "try...finally" block require a "catch" in the middle...?
Fred
|
|
|
|
|
Fred_Smith wrote: and doesn't a "try...finally" block require a "catch" in the middle...?
Nope. You may wish to clear up resources without catching the exception at this point.
|
|
|
|
|
I stand corrected.
Us VB lot can use "on error resume next" - much friendlier! This is much frowned upon by *real* (bow, scrape) programmers, but does have it's advantages...
Sorry, but poking C# programmers is almost as much fun as sticking it to the French!
F
|
|
|
|
|
I'm not sure about your error. But why do you seem to be writing a console application in an ASP.NET project?
|
|
|
|
|
You probably have one too many } at the end.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
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
|
|
|
|