|
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
|
|
|
|
|
Hi,
I explain my requirement with example.
Suppose GridView bind with 10 records. In each row in gridview have checkbox.Suppose i selected five record (i checked five checkbox).I need to update selected five records in database.
When I update first record I need to show updated Record in other gridview. same way when other record update i need to show updated record in other gridview.
it's urgent.please let me how to do it.
Note:-Update button is outside of gridview.
Thanks
Asif
.
modified 10-Jul-12 4:21am.
|
|
|
|
|
|
I am basically trying to step through my code for a C# 2010 web application and I can not see the value of my variables in most cases since the application is 'optimized'. Since I want to be able to see the values in variables whwn I step through the code, I will let you know what I have done to solve my problem and you might be able to tell me how to fix this problem:
1. I rebuild from the file menu.
2. I selected the configuation option to be 'debug',
3. for the project file that is the web app, I made certain the optimize was not checked.
4. When I went to windows--> debug--> modules I saw the following:
a. my specific dlls were recently compile, and they are optimized.
b. I find some microsoft dlls saying, "Cannot find or open the PDB file."
Thus can you suggest what I can to make certain my modules are not optimized so I can step through the code?
|
|
|
|
|
In your project properties, at the Build tab, there is an Advanced... button at the bottom right corner (Output section).
Click it and check the value of the Debug Info option. If it's not, try setting it to full and see if that helps.
2A
|
|
|
|
|
This option was already set on.
|
|
|
|
|
Check your web.config file, if it includes the compilation.debug option and it's set to true :
<configuration>
<system.web>
<compilation debug="true" />
</system.web>
</configuration>
Also, see if the Suppress JIT optimization on module load option is not unchecked. (It's found under Options->Debugging->General).
What exactly happens when you add a breakpoint and run your app?
2A
|
|
|
|
|
Until two weeks ago I could not even step through the code. I changed a debugging option to just be able to see my code.
I will check inot what you suggested.
basically what happens are the variables are optimized and that is why I can not see their values.
In all the project files, I have the 'optimized' option unchecked.
|
|
|
|
|
I am asking this question since I would like to know what is the best method of coding in a C # 2010 web form page that I just wrote. I read somewhere that everytime you need a datacontext object, you should
create it. There was no reference also to removing the datacontext object.
Thus on the current web form page that I am using that connects to a sql server 2008 r2 database, I am doing the following:
1. I never remove the AttDataContext from memory.
2. On the same web page, I am referring to the same linq to sql *.dbml file. However depending upon what I user clicks on, I have the following 3 datacontext objects:
a. AttDataContext,
b. Att2DataContext,
c. Att3DataContext.
Can you tell me if the above if a good idea or not? If not, can you tell me how I should use the same data context object on the same web form page?
|
|
|
|
|
Implement the using pattern when invoking these objects:
using (AttDataContext db = new AttDataContext())
{
}
This construct will close and dispose for you. You should not maintain an active connection where it is not required.
"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.
Is it possible to achive this:
(all is inside web.config)
<configuration>
<appSettings>
<add key="strSQLServer" value="srvproduction\SQL2008Express">
</appSettings>
<connectionStrings>
<add name="dbConn" connectionString="Data Source=" + key["strSQLServer"] + ";MultipleActiveResultSets=True;Initial Catalog=db1;Persist Security Info=True;Connection Timeout=600;User ID=sa;Password=***" providerName="System.Data.SqlClient"/>
</connectionStrings>
</configuration>
Like I said at the begining: all is inside web.config
??
|
|
|
|
|
Marius DUMITRU wrote: Is it possible to achive this:
(all is inside web.config)
connectionString="Data Source=" + key["strSQLServer"] + ";MultipleActiveResultSets=True;
No. Not possible. Web.Config is application's configuration file and not a programming logic in itself. You can maximum write in web.config file but it will not evaluate things in it by itself. It's a simple config file.
Last but not the least, what you ask is not needed - I don't think there is any reason to have/do it like this.
Config file is the way to provide defined connection string. If you want multiple datasource, then just define multiple connection strings.
Refer: MSDN: connectionStrings Element (ASP.NET Settings Schema)[^]
|
|
|
|
|
Why not just do this ?
<configuration>
<connectionStrings>
<add name="dbConn" connectionString="Data Source=srvproduction\SQL2008Express;MultipleActiveResultSets=True;Initial Catalog=db1;Persist Security Info=True;Connection Timeout=600;User ID=sa;Password=***" providerName="System.Data.SqlClient"/>
</connectionStrings>
</configuration>
As Sandeep said, you cannot have programming logic w/in your web.config file.
Cheers,
Karthik
|
|
|
|
|
When I am debugging a C# 2010 web application, I am getting the error, "A first chance exception of type 'System.Web.HttpParseException' occurred in System.Web.dll" sometimes.
I am wondering if you can suggest in what situations this error could be occuring and/or possibly help me to determine when this type of error is occuring?
The only thing I think that can be causing this error is when a user finishes working on my new pages on the company website. My new web pages run in a series of 5 pages. When they have finsished entering data for one customer i redirect the user to the first of the 5 pages. at any point the user can click the 'logout' button that is at the top of all the master pages. Could this be an issue?
|
|
|
|
|
When I am stepping through code for a C# 2010 web form application,there are times when I can see the values of variables and there are times where I can not see the value of variables. I am wondering what is causing this and how I make make certain I can see the values of the variables.
Here are some of the messages that I see and I am wondering if these error messages are related or not? What do you suggest I do to resolve the issues with the error messages?
fhe name 'filteredList' does not exist in the current context results Cannot obtain value of local or argument 'results' as it is not available at this instruction pointer, possibly because it has been optimized away. Step into: Stepping over method without symbols 'System.Web.UI.WebControls.ListControl.SelectedValue.get' Step into: Stepping over method without symbols 'string.Concat' Step into: Stepping over method without symbols 'System.Web.HttpApplication.ExecuteStep' Step into: Stepping over method without symbols 'System.Web.HttpApplication.BeginProcessRequestNotification'
Note: when a message says a value is not available, I am in the method at the time and I should be able to see value.
|
|
|
|
|
|
I did know what the following,"It might be that your project or solution is not in DEBUG mode."
Thus can you tell me how to make certain my proejct and solution are both in debug mode? I do not know how to do this.
|
|
|
|
|
Try: Right click solution -> Properties -> Configuration properties.
|
|
|
|