|
What does the error message tell you ? Where do you define the atk namespace ? do you have any idea what you're doing ?
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
I have a ASP.net Web application. I have master pages. I have 5 web forms with same controls. At run time based on user selection each form is loaded.
I have one Web form (city.aspx) with combobox and grid control
i have 5 other web forms (state.aspx,etc) with same controls i.e, combobox and grid control.
When the user selects City, city.aspx form is loaded. similarly when user selects State, state.aspx form is loaded.
I want to refactor code. Instead of 5 seperate .aspx and .cs files i want to refactor. As the structure is similar and only during run time the web page is populated with different data. Which design pattern i can apply to refactor my code? Your help is appreciated. thanks in advance
|
|
|
|
|
Please don't ask the same thing over and over, it's rude.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Hi to all,
I am stucked in a problem and searched a lot.
But I am unable to resolve the issue.Please help me out.
Actually i have datalist in which there is column of "stock_on_hand".In the database table the value is "20". I want that if the stock in the database table is greater than "0" then in the datalist column it should show the text "In Stock". For this I did like this:
protected void Page_Load(object sender, EventArgs e)
{
try
{
string snam = Session["na"].ToString();
chi_id = Convert.ToInt32(Request.QueryString["c_id"]);
get_names();
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["newcon"].ConnectionString);
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandText = "select product_id, image,price,sh_desc,case when stock_on_hand >0 then 'In Stock' else convert(nvarchar, stock_on_hand) end from " + snam + " where child_id=@child_id";
cmd.Parameters.Add("@child_id", SqlDbType.Int).Value = chi_id;
SqlDataAdapter sda = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
con.Open();
sda.Fill(dt);
DataView dview = dt.DefaultView;
DataList1.DataSource = dview;
DataList1.DataBind();
con.Close();
}
catch(SqlException se)
{
ErrHandler.WriteError(se.Message);
}
catch(Exception ee)
{
ErrHandler.WriteError(ee.Message);
}
}
But it is giving an error:
DataBinding: 'System.Data.DataRowView' does not contain a property with the name "stock_on_hand" .
I am unable to solve the issue.Please assist me.
cheers,
sneha
|
|
|
|
|
You need to add the alias name for that column as stock_on_hand .
select
product_id, image,price,sh_desc,
case
when stock_on_hand > 0 then 'In Stock'
else convert(nvarchar, stock_on_hand)
end AS stock_on_hand
from " + snam + " where child_id=@child_id OT : Are you aware of using statement in C#? Heard about dispose pattern? SqlConnection , SqlCommand , SqlDataAdapter and DataTable got a Dispose() method and you haven't called it. If dispose method is provided, it is a good practice to call it when you finish dealing with the object.
|
|
|
|
|
N a v a n e e t h wrote: You need to add the alias name for that column as stock_on_hand.
Hi,
Thanks for your generous help.I am sorry I missed it. Now it is working fine.
N a v a n e e t h wrote: OT : Are you aware of using statement in C#? Heard about dispose pattern? SqlConnection, SqlCommand, SqlDataAdapter and DataTable got a Dispose() method and you haven't called it. If dispose method is provided, it is a good practice to call it when you finish dealing with the object.
Now I will remember to use the dispose() after the work with the objects is completed. Thanks for youe suggestion. I will always keep in mind.
cheers,
sneha
|
|
|
|
|
I am working on an application to post the data from my database to a particular website. For that after loging in im taking the URL of the website and adding on the values in the form of query string. But instead of going to the same page it navigates to the login page. Please suggest me how to handle that issue.
Thanks in advance,
aravind sarma
|
|
|
|
|
What on earth does this have to do with the sessions ?
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
pamsbeach wrote: But instead of going to the same page it navigates to the login page
Navigates to the login page of the other website? Other website created by you? There will be some user authentication happening on the page load of that web page and when it fails it might be redirecting to login page.
Hard to tell more without knowing the exact scenario.
|
|
|
|
|
Hello...
I am running my web based project from Windows Vista and i got this error. Same project is working perfectly in Windows XP service pack 2.
Logon failed. Details: ADO Error Code: 0x Source: Microsoft OLE DB Provider for SQL Server Description: [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied. SQL State: 08001 Native Error: Error in File C:\Users\ADMINI~1\AppData\Local\Temp\crtFirstAidDetail {1D6C4EFB-F0DB-4AA1-A2EC-441EED35ECF5}.rpt: Unable to connect: incorrect log on parameters.
Please Advice.
“You will never be a leader unless you first learn to follow and be led.”
–Tiorio
"Coming together is a beginning, staying together is progress, and working together is success." Henry Ford
|
|
|
|
|
i use a t_session table to restrict the user to log in my site through only one browser, means the same user can't log in the site using two browsers at the same time and it works fine, but if the use didn't log off properly then he can't log in to the web till the session expires,at the session_end event t_session table is cleared.
what i want is to clear the table when the user closes the window with out log off properly
any idea how to do this
|
|
|
|
|
There is no reliable way to do this. An AJAX call to log off when the browser is closed will work for much of the time, but you should never write such a system and not add a timeout, so that if the user turns off their browser without logging off, they are only locked out until that timeout expires. You would then update that timeout every time they access a page on the site.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Some pages getting this error.Plz help!
<br />
Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.<br />
<br />
Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.<br />
<br />
Source Error:<br />
<br />
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.<br />
<br />
|
|
|
|
|
What does the message say ? What code generates it ? What have you done to follow the instructions the exception message gave you ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
It's a simple update profile page containing a form with loaded value.
Whenever the page is opened those msg are coming.
SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
What should I do to fix this?
|
|
|
|
|
Hi,
I want to create a file using FileStream, but I want the user selects the file Location on its machine to be saved.
How can I show a dialog Box for selecting a path.
I don't need a control with browse, just open a save as dialog and I create the file in the selected path
Best wishes
modified on Monday, March 30, 2009 3:24 AM
|
|
|
|
|
mehrdadc48 wrote: but I want the user selects the file Location on its machine to be saved
That shows your level of knowledge in web applications.
|
|
|
|
|
As Navaneeth said, the problem is that you have absolutely no idea what you are doing. Buy a book on ASP.NET and read it.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Could you please give me a short sentence about the complicated point of my post !?
I want user downloads a file, but the file is created run-time, not an available file on server.
I've exported an Excel file of a GridView data, now I can save it in a fix path on client (e.g. C:\1.xls), the thing I want is to ask the user about the path to be saved?
Best wishes
|
|
|
|
|
mehrdadc48 wrote: the thing I want is to ask the user about the path to be saved?
That is the problem. ASP.NET works on server and can't show dialog boxes on client machine. It is browsers job to show the save dialog box and you don't have any control over it.
|
|
|
|
|
Oh!
Are you familiar with products of DevExpress, Telerik, ... or just you know Microsoft products?
There are a lot of Controls that have both server-side and Client-Side capabilities, the Client-Side can be connected to Server-Side ones ...
Ok ,Take it easy. I'm not going to have an argument about it, maybe I'm wrong, but you can say in soft words.
Thank you for your attention.
Best wishes
|
|
|
|
|
Oh!
I said I don't need a control. I just need a smart code to enforce the browser to show dialog, and I use the selected path.
Ok ,Take it easy. I'm not going to have an argument about it, maybe I'm wrong, but you can say it in soft words.
Thank you for your attention.
Best wishes
|
|
|
|
|
mehrdadc48 wrote: I just need a smart code to enforce the browser to show dialog
I reiterate. It is totally controlled by the browser.
mehrdadc48 wrote: but you can say it in soft words.
I don't think I was rude. But if you are hurt, honestly, that was not my intention.
|
|
|
|
|
If you feed a file down from the server, the client will be prompted the path to save to. Always. Your post seems to indicate that you have no idea about the seperation between server and client, what happens on the server, and what happens on the client. If you save the file to the client, they will be asked where to save it, every time.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Hi Friends,
I have a doubt in routing.I send an action code view to a page on button click of another page.How i get the action name in the second pageload.Please help me.
|
|
|
|