|
At first I don't know if I posted this question in corresponding section, because I could not find theme of Hibernate
well I'm newbie of NHibernate
when i executing my nhibernate example then i receive error but I also Set Embedded Resource Property to true of xml file
public class UserData{
public void CreateUserAndSaveToDatabase() {
User u = new User();
u.ForeName = "John";
u.SureName = "Smith";
using (ISession session = factory.OpenSession()) {
using (ITransaction transaction = session.BeginTransaction()) {
session.Save(u);
transaction.Commit();
}
}
ISessionFactory factory = new NHibernate.Cfg.Configuration().Configure().BuildSessionFactory();
}
NHibernate.MappingException: Unknown entity class: HibernateCollaborator.Core.User
what's the problem??
would you advice me anything to solve this problem
C# Developer
modified on Friday, December 11, 2009 12:38 PM
|
|
|
|
|
Dear all,
This is an interview question.
I have 2 user controls placed in my web page say usercontrol1 and usercontrol2.
In usercontrol1 i have all filter parameters (which user will selects) and a submit button.User selects and clicks on submit button.
After clicking on submit button we need to show the data in usercontrols2.....How??
Inorder to achive above we should not use query string,sessions,viewstate...Then what we should use.Please give your ideas.
Can we use Events and delegate mechanism here???
Thanks,
Srinivas Mateti
9440071311
|
|
|
|
|
Delegates. That is what I use whenever I have to do something like that.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
Hi,
I've created a website on locall network at my work,
throught the web i approach to a directory that located on other srver at the same network.
My problem is that when i'm trying to access to a file on the other server i'm getting an "access denied" error.
FileInfo[] fi = (new DirectoryInfo(@"server name\C$\some directory\").GetFiles("*.sql"));<br />
this.DropDownList1.DataSource = fi;<br />
this.DropDownList1.DataBind();<br />
Is it possible that i can't do it?
|
|
|
|
|
You need to provide access to the user under which your website runs on the server.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
i'm login with my user,
ans i have access to the directory on the server.
|
|
|
|
|
Did you provide the permission for the same ? Does that folder is a shared folder ?
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
hi all,
currently i have a project on dotnetnuke. and i dont know how to start so anybody please help.
thanks in advance
|
|
|
|
|
There are thousands of articles on Google, and probably more than a few on the dotnetnuke web site. Try those.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
|
hii
m using image button in adatalist.I want that when user clicks on this button a new window gets opened
with a big size of image.I have tried using this:
<asp:ImageButton ID="ImageButton1" runat="server" Height="200px"
ImageUrl='<%# Eval("ProductImg", "{0}") %>' Width="200px"
BorderColor="Black" BorderStyle="Solid"
PostBackUrl='<%# Eval("ProductID","ImageEnlarge.aspx?ProductID={0}") %>' />
the image gets opened but i want it to open in new window.
how can i open the image in new window plz guide.
thanks in advanc.
|
|
|
|
|
Use a asp:HyperLink and set the image url and set the target attribute to _blank to open in a new window!
Check this[^] for details
|
|
|
|
|
Just use
window.open in OnClientClick of the Imagebutton to invoke the javascript new window.
Just place the id of the image in querystring, so that when the server is called, the proper image to be shown in the window.
|
|
|
|
|
|
I am also agree with Abhishek, Use Window.Open(). Avoid unnecessary Postback ! .
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Hi,
Call this script.
javascript:openPopup('ImageEnlarge.aspx?productid=<%#eval("productid") %>')
function openPopup(strOpen)
{
open(strOpen, "Info", "status=1, width=350, height=338, top=0, left=300, scrollbars=no");
}
I hope this will help you
Farogh Haider
Web developer
|
|
|
|
|
Hi Friends,
I am having table with below data
District Sate Mandal
------- --- ------
Nalgonda AP Nalgona
Tirupathi AP Chithoor
Output should be
District Sate Mandal Address
------- ----- ------ -------
Nalgonda AP Nalgona Nalgonda,AP,Nalgona
Tirupathi AP Chithoor Tirupathi,AP,Chithoor
Address should be District,Sate,Mandal
|
|
|
|
|
|
select district,sate,mandal,mandal +','+sate+','+district AS [Address] from myTable
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
I defined a column in db(sql) as numeric...i'm retrieving it in code behind with a variable declared as double...and mailing it...recently i stored a value 5 , but in mail it is displayed as -1...when i did line by line execution the variable showed 5!!!
not only this time in the past i received few mails with -1, instead of some other value!!!
|
|
|
|
|
In which case your code is wrong. As all you have said is that the data is not as expected nobody can tell you why. At a guess somewhere between retriving the value and sending the mail you lose/corrupt it. Try debugging all the way through and you will see where it goes wrong.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Hi
I need advice on which way to proceed. I have two scenarios
Case 1:
I have an aspx page which reads from a Xml file using XmlDcoument object, process it and stores the data in a datatable. The datatable may contain from 10 to max 1000 rows depending on the Xml file.
I am using couple of update panels and hence there are frequent postbacks expected. My question is which would be better performancewise :
1. Store the datatable in viewstate / Cache / Session OR
2, Read the data from Xml file and build the datatable during each postback.
Pls note that the xml file is very big and the processing involves multiple loops before storing the data in the required format in the datatable.
Case 2:
Here is a datatable whose rows are created based on the user input during partialpostbacks. The data should be retained until the final submit button is pressed. What would be the best way to achieve it.
Store the datatable in viewstate Or Cache Or Session or declaring it as static.
Please note that both the datatables are just pagelevel and multiple users may access it. I want each user to have their own copy of the datatable.
any guidance on which way to choose would be appreciated.
thanks
Kit.
|
|
|
|
|
Well, you must first be aware of the differences of functionalities between session, asp Cache and viewstates. It is not only about memory.
For example:
You load your page. You store some data in ViewState["x"].
You load another page. You also store some data in ViewState["x"], but it is a different data.
No problem will be caused, as ViewState is linked to the calling page. If you open a new web-browser in the same page (Control+N) as soon as you do anything different, each page (the old and the new) will have different view-states, so the old-page will not display the new data if you press F5, for example.
Session. If you put information named "X" in session, every page will share the same information. If you update information X in one page, it will also change the X visible in another page, which may not be wanted. But, of course, it will not affect other users, as they will have other sessions.
Asp Cache. The cached item will be shared among all users. This is rarelly what is needed.
The biggest problem of ViewState is that it is sent to the client. So, many times reprocessing the item is better (faster) than sending it to the client and receiving it back. But, I must say I have a solution for this.
Look at my article:
Pfz.Caching - ViewIds instead of ViewStates[^]
Using it, the view-state will works as always in terms of being exclusive to a page, a Control+N will not corrupt it, but it will be kept in the server memory and/or disk, without being sent to the client. Probably the easiest and faster solution considering general cases.
|
|
|
|
|
Thanks for the reply, Paulo.
I think I should explain my situation a bit more in detail. I am working on the reporting stuff - that produces a chart. The datatable stores the different data entered by the user that should appear in the chart. For someother reasons there are a couple of partial postbacks before the chart is generated. I need to hold the user specifications until the actual chart is generated.
I am really fine with the Ctrl+N problem When the user presses Ctrl+N to open another instance of the same page, it might be like he wants to see two different formats of report. In that case I am glad if the viewstate values of old and new page remains different. thats what I exactly want.
I could achieve this behaviour with viewstate and also by declaring the datatable as static at page level. eg
static DataTable dt1 = new DataTable();
Even with declaring dt1 as static, Ctrl+N does not affect the old page. Old and new page has their own copy of the dt1 which is what i want.
But I wonder which is efficient and is there anyother better way of doing it. (Just to remind you that this datatable is used only in the single page)
|
|
|
|
|
The different copies are only achieved with ViewState. Using session or cache, except that you give different names, will not achieve different copies. That's why I say you must use ViewState.
The only problem with normal viewstate is that it is sent to the client and so, if the data is large, it could make the page load really slowly. That's why I talked about my ViewState solution.
So, go for the ViewState.
|
|
|
|