|
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
|
|
|
|
|
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.
|
|
|
|