|
Hi,
As per my understanding, its a data convertion issue, its trying to convert from a string to int.
you can try below:
CAST(MyVarcharCol AS INT))
or
CONVERT(INT, MyVarcharCol)
|
|
|
|
|
You'll need to see what the actual value is. Step through with a debugger and/or add a try/catch to log the value somewhere.
|
|
|
|
|
I have a C# 201o web form application that I just deployed to a test server that is similar to the production server running iis 7. The entire website works fine but the screens only stay active for an inconsistent amount of time. The entire website throws you back to the main logon screen. Thus can you tell me what kind of a setting for the entire web site and/or iis server that needs to be changed so the server and /or application does not throw you out to the logon page after being on the website for 5 minutes or less?
|
|
|
|
|
|
This article says the default timeout for asp.net is 20 minutes. However, my website closes down after 3 to 5 minutes at the most.
Thus do you think something else could be wrong? Do I just need to set the session timeout value since I do not have the value set?
|
|
|
|
|
Verify Web.Config file, what the time is set for Form authentication tag?
Parwej Ahamad
|
|
|
|
|
dcof wrote: website throws you back to the main logon screen
This is like the 3rd time I read the question.
I didn't think much at first of the question because it did sound like a session issue.
So do you mean that if you navigate to a page, and sit in your chair and watch it, the page automatically navigates to the login screen?,
or if you get a phone call, and your talking on the phone, the page redirects?
dcof wrote: <layer>but the screens only stay active for an inconsistent amount of time.
Is the incosistent time always on the same computer?, or various computers.
|
|
|
|
|
Do you have an example with asp:Panel to look like tab control?
|
|
|
|
|
Tab control for ASP.NET Applications[^].
Good place to start: there are a few other similar articles.
There's also Google[^]
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
|
hello friends i am fresher i need real time example for using oops in asp.net with C# application..give me some code..
|
|
|
|
|
|
Start with some good samples on msdn.
You can also pick up a good book and read.
|
|
|
|
|
|
|
Try DotnetFunda, Questpond. The second one requires a payment for their training and dvd's. But the amount is very nominal and worth it.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
You can for example enter the length and width of the web (VS.NET2005), when it runs out of range index error exception was unhandled by user code for chieudai
public class Tinh
{
private Int32 _quanhuyen;
private String _diachiNha;
private Double _chieudai;
private Double _chieurong;
private Double _dientichDat;
}
public Int32 Quanhuyen
{
get { return _quanhuyen; }
set { _quanhuyen = value; }
}
public String DiachiNha
{
get { return _diachiNha; }
set { _diachiNha = value; }
}
public Double Chieudai
{
get { return _chieudai; }
set { _chieudai = value; }
}
public Double Chieurong
{
get { return _chieurong; }
set { _chieurong = value; }
}
public Double DientichDat
{
get { return _dientichDat; }
set { _dientichDat = value; }
}
private Tinh DienTich(IDataReader dr, bool GetTotalRecords)
{
Tinh obj = new Tinh();
...
obj.Quanhuyen = (dr["Quanhuyen"] is DBNull) ? Int32.MinValue : (Int32)dr["Quanhuyen"];
obj.DiachiNha = (dr["DiachiNha"] is DBNull) ? String.Empty : (String)dr["DiachiNha"];
// bottom line this error index out of range exception was unhandled by user code
obj.Chieudai = (dr["Chieudai"] is DBNull) ? Double.MinValue : (Double)dr["Chieudai"];
obj.Chieurong = (dr["Chieurong"] is DBNull) ? Double.MinValue : (Double)dr["Chieurong"];
obj.DientichDat = (dr["DientichDat"] is DBNull) ? Double.MinValue : (Double)dr["DientichDat"];
if (GetTotalRecords)
obj.TotalRecords = (dr["TotalRecords"] is DBNull) ? -1 : Globals.ConvertToInt32(dr["TotalRecords"]);
return obj;
}
error index out of range exception was unhandled by user code
modified 11-Jul-12 3:04am.
|
|
|
|
|
On which line you are getting this error ?
|
|
|
|
|
Your coding skills look pretty advanced, I don't see why you can't figure it out yourself.
Why is chieudai a double and not a Int32?, you would think all the obj have the same value, since it's a list of people. I don't understand chieudai, is it a lemon, lime, orange, or cherry.
Did you assign the property chieudai a default value, if the property is not set in the web form.
|
|
|
|
|
I fixed all right, thank you for comments
|
|
|
|
|
hi i have a doubt about expire validation of user i make some thing. i am not sure about this .
Below code the all loop are not working.
String edate = session["edate"].ToString();
String today = DateTime.Now.ToString("d");
int result = edate.CompareTo(today);
if (result == 0)
{
Response.Write( "your account expire on today ");
}
else if (result < 0)
{
Response.Write("your account exipired ");
}
else
{
Response.Write("your account expire on next week ");
}
can anyone help
thanks
|
|
|
|
|
Try this code, I have skipped some validations and null checks so you can put them in place if it works.
String edate = session["edate"] as string;
DateTime convertedDate = DateTime.Parse(edate);
if (convertedDate == DateTime.Today)
{
Response.Write( "your account expire on today ");
}
else if (convertedDate > DateTime.Today)
{
Response.Write("your account exipired ");
}
else
{
Response.Write("your account expire on next week ");
}
Every now and then say, "What the Elephant." "What the Elephant" gives you freedom. Freedom brings opportunity. Opportunity makes your future.
|
|
|
|
|
I have the following questions about a linq to sql connection in a C# 2010 web
form application when comparing the *.dbml file to the web.config file:
The questions refer to the code listed below:
1. The top of the *.dbml file and the web.config file, there are refernces to
"TST_DEV" and "TST_DEV2". Can this discrepancy cause problems in the web form
application? If so, can you tell me how? I am asking this question since most
references in the production application refer to "TST_DEV" or "TST_DEV2" in the
same .dbml file and do not mix the references.
2. I do not understand what the
'name="Dmport.Properties.Settings.DBConnectionString" can be referring to. Can
you tell me what it is referring to?
3. Are the refernces to "DBConnectionString" in the .dbml file and web.config
file all related to each other? If so, would you tell me how all these items are
related to each other? If not, can you tell me what each "DBConnectionString" is
referring to?
top of .dbml file
<?xml version="1.0" encoding="utf-8"?><Database Name="TST_DEV"
Class="HisDataContext" xmlns="http://schemas.microsoft.com/linqtosql/dbml/2007">
<Connection Mode="WebSettings" ConnectionString="Data
Source=SP9\MSSQL2008;Initial Catalog=TST_DEV2;Persist Security Info=True;User
ID=xx" SettingsObjectName="System.Configuration.ConfigurationManager.ConnectionS
trings"
SettingsPropertyName="DBConnectionString" Provider="System.Data.SqlClient" />
applicable web.config file
<add name="DBConnectionString" connectionString="Data Source=sqldev;Initial
Catalog=Tst_DV;Persist Security Info=True;User ID=R2;Password=A"
providerName="System.Data.SqlClient" />
<add name="Dmport.Properties.Settings.DBConnectionString"
connectionString="Data Source=sqldev;Initial Catalog=Tst_DV;Persist Security
Info=True;User ID=R2;Password=A" providerName="System.Data.SqlClient" />
<add name="TST_DEVConnectionString" connectionString="Data
Source=sqldev;Initial Catalog=Tst_DV;Persist Security Info=True;User
ID=R2;Password=A" providerName="System.Data.SqlClient" />
<add name="TST_DEV2ConnectionString" connectionString="Data
Source=sqldev;Initial Catalog=Tst_DV;Persist Security Info=True;User
ID=R2;Password=A" providerName="System.Data.SqlClient" />
|
|
|
|
|
Hi,
I have an asp.net application in which I want to retreive the data from an uploaded excel file.
I am doing everything good but dates are not getting formatted properly. Is there any way to findout the Date1904 value for the uploaded excel file in ASP.Net application.
Any code snippet or link would help a lot.
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
Hello All
I am new to MVC3 and i need some help in understanding a issue.
I am using buttons on a page the button in question is a ADD Button. what i want to achieve is when user click button (Add create new) i want to return page (blank page) for user input for creating a new customer? In the call would i use a GET or POST method from the controller?
An example would really be appreciated
Regards
Kurt
|
|
|
|