Click here to Skip to main content
15,890,741 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Generate and render reports to PDF in a loop using ReportViewer in VS2005 Pin
sidbaruah19-Mar-08 20:36
sidbaruah19-Mar-08 20:36 
Questionhow to export data to powerpoint using vs2005 Pin
27185324119-Mar-08 16:21
27185324119-Mar-08 16:21 
AnswerRe: how to export data to powerpoint using vs2005 Pin
sidbaruah19-Mar-08 21:47
sidbaruah19-Mar-08 21:47 
GeneralParse the selected value from ddl and fill another ddl with information + NHibernate + C# Pin
Thommie.h19-Mar-08 11:16
Thommie.h19-Mar-08 11:16 
GeneralRe: Parse the selected value from ddl and fill another ddl with information + NHibernate + C# Pin
Marco van der Linden19-Mar-08 11:50
Marco van der Linden19-Mar-08 11:50 
GeneralRe: Parse the selected value from ddl and fill another ddl with information + NHibernate + C# Pin
Thommie.h20-Mar-08 5:40
Thommie.h20-Mar-08 5:40 
GeneralRe: Parse the selected value from ddl and fill another ddl with information + NHibernate + C# Pin
Marco van der Linden20-Mar-08 6:06
Marco van der Linden20-Mar-08 6:06 
GeneralRe: Parse the selected value from ddl and fill another ddl with information + NHibernate + C# [modified] Pin
Thommie.h20-Mar-08 7:29
Thommie.h20-Mar-08 7:29 
Hi,

My code looks like this and it doesnt work:
This is with NHibernate.

The error code : fetchQ.ParamName = "Region.Id";
The error text: NHibernate.QueryException: Type mismatch in NHibernate.Expression.EqExpression: Region.Id expected type System.Int32, actual type System.String

RegionId in database is int. And the hbm file is mapped Int32

private void BindMunicipalities(int regionId)<br />
    {<br />
        try<br />
        {<br />
            <br />
            string municipalityHql = "SELECT count(municipality.Id) from Municipality municipality WHERE municipality.Region.Id = :regionId";<br />
<br />
            IList<query> queries = new List<query>();<br />
            Query q = new Query();<br />
            q.ParamInt = regionId;<br />
            q.ParamName = "regionId";<br />
            queries.Add(q);<br />
<br />
            int municipalityCount = DataManagement.CoreRepository.RunCountStatement(municipalityHql, queries);<br />
<br />
            if (municipalityCount > 0)<br />
            {<br />
<br />
                IList<query> fetchQueries = new List<query>();<br />
                Query fetchQ = new Query();<br />
                fetchQ.ParamName = "region.Id";<br />
                fetchQ.ParamInt = regionId;<br />
                fetchQ.ParamEvaluationType = EvaluationType.Equals;<br />
                fetchQ.ParamString = string.Empty;<br />
                fetchQueries.Add(fetchQ);<br />
<br />
                IList<municipality> municipalities = DataManagement.CoreRepository.GetAll<municipality>(fetchQueries, 0, 0, true, "Name");<br />
                ddlMunicipality.DataValueField = "Id";<br />
                ddlMunicipality.DataTextField = "Name";<br />
                ddlMunicipality.DataSource = municipalities;<br />
                ddlMunicipality.DataBind();<br />
            }<br />
        }<br />
<br />
        catch (Exception ex)<br />
        {<br />
            logger.Error("Failed to load municipalities.", ex);<br />
            this.lblError.Visible = true;<br />
        }<br />
<br />
    }<br />
<br />
<br />
    protected void ddlRegions_SelectedIndexChanged(object sender, EventArgs e)<br />
    {<br />
        <br />
        this.BindMunicipalities(int.Parse(this.ddlRegions.SelectedValue));<br />
<br />
    } <br />
</municipality></municipality></query></query></query></query>


modified on Thursday, March 20, 2008 5:16 PM

Questionget data from gridview row before delete ? Pin
C. L. Phillip19-Mar-08 11:09
C. L. Phillip19-Mar-08 11:09 
AnswerRe: get data from gridview row before delete ? Pin
C. L. Phillip20-Mar-08 4:12
C. L. Phillip20-Mar-08 4:12 
QuestionUsing Certificates with c# and ASP.NET Pin
sfog19-Mar-08 11:08
sfog19-Mar-08 11:08 
GeneralCross post - please ignore Pin
pmarfleet19-Mar-08 11:14
pmarfleet19-Mar-08 11:14 
QuestionBusiness Logic and the current context Pin
Adriann19-Mar-08 11:08
Adriann19-Mar-08 11:08 
GeneralRe: Business Logic and the current context Pin
AlexeiXX319-Mar-08 15:41
AlexeiXX319-Mar-08 15:41 
GeneralRe: Business Logic and the current context Pin
Adriann20-Mar-08 6:58
Adriann20-Mar-08 6:58 
GeneralRe: Business Logic and the current context Pin
Adriann23-Mar-08 6:25
Adriann23-Mar-08 6:25 
QuestionHow to re-use one SqlDataSource for mutiple grids with different parameters Pin
Brady Kelly19-Mar-08 7:58
Brady Kelly19-Mar-08 7:58 
AnswerRe: How to re-use one SqlDataSource for mutiple grids with different parameters Pin
ashish bhakhar21-Mar-08 0:52
ashish bhakhar21-Mar-08 0:52 
GeneralChanges not applying in production Pin
macca2419-Mar-08 6:23
macca2419-Mar-08 6:23 
GeneralRe: Changes not applying in production Pin
Christian Graus19-Mar-08 10:45
protectorChristian Graus19-Mar-08 10:45 
GeneralRe: Changes not applying in production Pin
Adriann19-Mar-08 11:12
Adriann19-Mar-08 11:12 
QuestionDisplay data from a database without using gridview etc. Pin
ahlaj7719-Mar-08 5:06
ahlaj7719-Mar-08 5:06 
General[Message Deleted] Pin
eyeseetee19-Mar-08 5:18
eyeseetee19-Mar-08 5:18 
GeneralRe: Display data from a database without using gridview etc. Pin
Not Active19-Mar-08 5:47
mentorNot Active19-Mar-08 5:47 
General[Message Deleted] Pin
eyeseetee19-Mar-08 6:07
eyeseetee19-Mar-08 6:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.