urgent

Posts   
 
    
Eagle83 avatar
Eagle83
User
Posts: 37
Joined: 23-Apr-2007
# Posted on: 25-May-2007 17:00:47   

i have a problem in using combobox in lblgen, the problem is like following: when i type this code in form's load in order to obtain the combobox's content,

private void frmOpportunite_Load(object sender, EventArgs e) { DataAccessAdapter adapter = new DataAccessAdapter(); ec = new EntityCollection(new NomconcurencesEntityFactory()); adapter.FetchEntityCollection(ec, null);

        CbConcurA.DataSource = ec;
        CbConcurA.DisplayMember = "Designation";
    }

i obtain this result:

download image

jmeckley
User
Posts: 403
Joined: 05-Jul-2006
# Posted on: 25-May-2007 17:40:14   

I assume this is a web form. You don't need CbConcurA.DisplayMember. Set the source and call DataBind();

CbConcurA.DataSource = ec;
CbConcurA.DataBind();

if this doesn't solve your problem post the aspx and what you want the output to look like.

Eagle83 avatar
Eagle83
User
Posts: 37
Joined: 23-Apr-2007
# Posted on: 27-May-2007 01:06:59   

no it's a C# form sorry your code is not match help me please

jmeckley
User
Posts: 403
Joined: 05-Jul-2006
# Posted on: 27-May-2007 02:43:24   

Eagle83 wrote:

no it's a C# form

you mean a desktop form? the language doesn't matter. ((C#, VB, J#)

anyway.... 2 other thoughts. is ec defined outside the function? if not you need to delcare the variable

IEntityCollection ec = new EntityCollection(new MyEntityFactory());

You also need to define which field is the value and which is the text.

If this is a desktop GUI then the dropdown has richer features then the webform dropdown. Web forms only have value (string) and text (string).

Eagle83 avatar
Eagle83
User
Posts: 37
Joined: 23-Apr-2007
# Posted on: 28-May-2007 01:42:00   

the variable "ec" is already declared away from the function so it's not the problem that i have there is an other raison for this error??? thank you for your messages, i must solve this issue pleaaaaaaase help me

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 28-May-2007 06:39:28   

Eagle, if you are working on a WinAPP, your first post should work. I'm sure is a trivial problem. If you want, you can attach a zip file of your project to this thread or send it to me (david.elizondo@llblgen.com or support@llblgen.com) to see what's happening.

David Elizondo | LLBLGen Support Team
Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 29-May-2007 08:12:20   

And if this is .NET 2.0, we should try using a BindingSource(http://msdn2.microsoft.com/en-us/library/system.windows.forms.bindingsource(VS.80).aspx)

i obtain this result:

download image

What image? Where is the error/result?

Eagle83 avatar
Eagle83
User
Posts: 37
Joined: 23-Apr-2007
# Posted on: 29-May-2007 15:52:08   

the project below is where i have the problem, the error is generated in the form named : "frmProgrammeIntervention.cs" which contains the combobox named "cmbCodeTechnicien" an other problem concerns the method "contains" of an EntityCollection, i use it to verifie if an ClassEntity founded in this EntityCollection but it dosen't work even if there is no errors generated, this problem is in the same form "frmProgrammeIntervention.cs" "(AllReclamations.Contains(Reclamation))" can u tell me how to use a view to know the "maximum of opportunities"! thanks again for u're help link download project http://www.4shared.com/file/16877980/fa2c6092/Projet_stage_final.html

jbb avatar
jbb
User
Posts: 267
Joined: 29-Nov-2005
# Posted on: 29-May-2007 16:08:32   

Hello,

could you please post the error thrown for your first problem.

For the second problem, what problem do you have during the execution(entity not found, error....)?

Eagle83 avatar
Eagle83
User
Posts: 37
Joined: 23-Apr-2007
# Posted on: 29-May-2007 17:36:22   
daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 29-May-2007 20:31:01   

Mr. Eagle. Are you sure that **NomconcurencesEntity **already have a **Designation **field??? please confirm that coz I'm pretty sure it doesn't belongs to NomconcurencesEntity.

For future threads, you can attach the image to the post.

David

David Elizondo | LLBLGen Support Team
Eagle83 avatar
Eagle83
User
Posts: 37
Joined: 23-Apr-2007
# Posted on: 30-May-2007 14:33:12   

the error is generated in the form named : "frmProgrammeIntervention.cs"

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 30-May-2007 16:24:51   

Hi Mr. Ramzi.

I'm a little bit confused here, are we talking about the same issue since the start of the thrid or not.

Since it was first about frmOpportunite then you talked about frmProgrammeIntervention. I wonder if these are about the same thing or not.

Nayway looking at the code of frmProgrammeIntervention and the code of the TechniciensEntity.cs You should use the following

cmbCodeTechnicien.DataSource = Technicien; cmbCodeTechnicien.DisplayMember = "CodeTechnicien";

rather than:

cmbCodeTechnicien.DataSource = Technicien; cmbCodeTechnicien.DisplayMember = "CODE_TECHNICIEN";

"CODE_TECHNICIEN" is the database column name "CodeTechnicien" is the corresponding generated EntityField name

Eagle83 avatar
Eagle83
User
Posts: 37
Joined: 23-Apr-2007
# Posted on: 30-May-2007 17:17:55   

you're right walaa i'm very sorry thx for your answer i will try thx again