|
Hi,
Suppose i have an entity class which belongs to version table in the database having following properties for the fileds(columns)
#region Properties
private string _Program;
public string Program
{
get { return _Program; }
set { _Program = value; }
}
private string _AllowVersion;
public string AllowVersion
{
get { return _AllowVersion; }
set { _AllowVersion = value; }
}
#endregion
Suppose in a method i need to pass only one property so i will have to intitalize Entity class of version
which will have two properties but i need only one.
Do we have any way to tell version entity class that only load AllowVersion property only while initializing version entity and discard rest of the properties i.e my VersionEntity object must have only
one field.
I guess the only possible ways could be attributes or reflection. If possible please provide code snippet
to achieve this.
Is it possible to do this without performance cost??
Thanks In Advance
|
|
|
|
|
Hello Experts,
I am Creating Printer For PDF Writing Like: Windows XPS Document Writer,Journal Note Writer.
If you have any type of suggestion. Your most thanks.
Thanks
If you can think then I Can.
|
|
|
|
|
Your answer is here[^]
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
Help humanity, join the CodeProject grid computing team here
|
|
|
|
|
eg_Anubhava wrote: I am Creating Printer For PDF Writing
You probably need to start here[^] for details on the PDF data formats.
However, you can also check Google for one of the existing products.
|
|
|
|
|
i can write a file in the any drive of XP operating System but i can not on vista. plz see my code and suggest me how i can write on VISTA operating System.
Server = txtServerHost.Text.Trim();
User = txtUserName.Text.Trim();
Password = txtPassword.Text.Trim();
DBName = "db_outlook";
DataTable dt = new DataTable("Server Configuration");
dt.Columns.Add("Server");
dt.Columns.Add("User");
dt.Columns.Add("Password");
dt.Columns.Add("DBName");
dt.Rows.Add(Server, User, Password, DBName);
dt.WriteXml(Application.StartupPath + "\\ServerInformation.bin");
Thanks in advance
|
|
|
|
|
If you launch your program from the Program Files folder I don't think you're allowed to write to that directory in Vista.
|
|
|
|
|
thanks for ur reply. yes when i install the software it creates into program file. it creates in xp but not in VISTA.
have any permission system?
plz help me...
thanks
|
|
|
|
|
I think Microsofts policy in Vista and 2008 Server is that you shouldn't write to the Program Files folder (except at install time). Simply choose another folder to store that file (for instance another predefined folder found in Environment.SpecialFolder ). But as someone else wrote, do you really want to store a password in plain text like that?
|
|
|
|
|
thaks for ur reply.i will not put password info in plain text. but if i do that in installation time file can not create.
it is not possible? what i changed in my code. i will try it in diffent directory.
Thanks
|
|
|
|
|
Don't store stuff in program files!
There are two folders recommended for application storage depending on whether the data being stored is user specific.
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData);
|
|
|
|
|
thank u very much for ur reply
|
|
|
|
|
What error message are you getting.
By the way it is a REALLY bad idea to store passwords and usenames in plain text
CCC solved so far: 2 (including a Hard One!)
|
|
|
|
|
thanks for ur reply. no error message shown. only i found no file is created in program file.
if i wanna write how? i created it in startup path if i install in different drive. will it install and create the file?
Thanks
|
|
|
|
|
khosnur wrote: i can write a file in the any drive of XP operating System but i can not on vista.
I just tried this on Windows 7 and it worked fine. Have you run it through the debugger to check the value of Application.StartupPath ?
|
|
|
|
|
Hello there,
i'm trying to create a program that copies some files to the CD BLANK area.
i created the program working For Windows XP, but in Vista it is not working/
can anyone help me in that
thanks in advance
|
|
|
|
|
There was a component called XPBurn, which worked in XP. If it's not supported in Vista, then you need to search the web for samples in Vista, assuming it's even possible in Vista.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Using Image mastering API[^] might be help. If I am not wrong there was an article on CP about using IMAPIv2
Sohail
modified on Wednesday, September 30, 2009 8:50 AM
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Hi.
I saved color in Mssql datatable from C# colordialog (colordialog.color.toArgb() & 0xFFFFFF )and i put the result in crystal report color formula but the result is not the color what i choose in colordialog window.
Why ? What's wrong ?
Excuse me for my English
THX.
|
|
|
|
|
C# colors are ARGB, might Crystal Reports use RGB or BGR ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
If I want to locate the minimum value for a column in a datatable I would use something like:
int minArrangementID = (int) debtorDataSet.PaymentArrangements.Compute("MIN(PaymentArrangementID)", "PaymentArrangementID > 0");
How can I find the minimum value within a binding please?
|
|
|
|
|
Hi;
I'm calling stored procedures using linq to sql to fill comboboxes from a database.
I have the method ConnectFilter() above that i want to refactor.
I started refactoring using FillComboWithData(ComboBox combo, string value, string display, DataClassesReferentielDataContext dc, XXXXX) above.
DataClassesReferentielDataContext is the Linq datacontext, it contains all the database mapped into objects.
By the way the stored procedures call many fields of many tables.
Here an example of a stored proc: P_ESS_Categorie_BIS.
I don't know how to enter the stored procedure as an argument (in place of XXXXX).
I think the argument should be an enumerable.
Thanks.
private DataClassesReferentielDataContext _dc = new DataClassesReferentielDataContext();
private void ConnectFilter()
{
comboBoxCountryFilter.DataSource = _dc.P_ESS_Entite();
comboBoxCountryFilter.ValueMember = "PAY_Code";
comboBoxCountryFilter.DisplayMember = "PAY_Libelle";
var statut = from s in _dc.TR_Statuts select s;
comboBoxStatusFilter.DataSource = statut.ToArray();
comboBoxStatusFilter.ValueMember = "STA_ID";
comboBoxStatusFilter.DisplayMember = "STA_Libelle";
comboBoxCategoryFilter.DataSource = _dc.P_ESS_Categorie_BIS((int) Selections.VueRefId);
comboBoxCategoryFilter.ValueMember = "CAT_Code";
comboBoxCategoryFilter.DisplayMember = "CAT_Libelle";
comboBoxItPlanFilter.DataSource = _dc.P_ESS_ITPlan_BIS((int) Selections.VueRefId);
comboBoxItPlanFilter.ValueMember = "ITP_Code";
comboBoxItPlanFilter.DisplayMember = "ITP_Libelle";
comboBoxGroupFilter.DataSource = _dc.P_ESS_GroupeProjet_BIS((int) Selections.VueRefId);
comboBoxGroupFilter.ValueMember = "GRP_Code";
comboBoxGroupFilter.DisplayMember = "GRP_Libelle";
comboBoxSponsorFilter.DataSource = _dc.P_ESS_Sponsor_BIS((int) Selections.VueRefId);
comboBoxSponsorFilter.ValueMember = "SPO_Code";
comboBoxSponsorFilter.DisplayMember = "SPO_Libelle";
comboBoxThemaFilter.DataSource = _dc.P_ESS_ThematiqueProjet_BIS((int) Selections.VueRefId);
comboBoxThemaFilter.ValueMember = "THE_Code";
comboBoxThemaFilter.DisplayMember = "THE_Libelle";
comboBoxPersonFilter.DataSource = _dc.P_TR_Personne_Liste_Filtre();
comboBoxPersonFilter.ValueMember = "PER_ID";
comboBoxPersonFilter.DisplayMember = "PER_NomUT";
}
private void FillComboWithData(ComboBox combo, string value, string display, DataClassesReferentielDataContext dc, XXXXX)
{
combo.DataSource = _dc.P_ESS_NatureProjet_BIS((int)Selections.VueRefId);
combo.ValueMember = value.Trim();
combo.DisplayMember = display.Trim();
}
ALTER PROCEDURE [dbo].[P_ESS_Categorie_BIS]
@Vue_Referentiel numeric(10,0)
AS
BEGIN
SELECT [CAT_Code]
,[CAT_Libelle]
FROM [TR_Categorie]
WHERE ([TR_Categorie].VUR_Id = @Vue_Referentiel)
order by [CAT_Libelle]
END
|
|
|
|
|
Hi . I can not good speak english . if in vs 2008 pressed ctrl + G keys and insert line number and click ok button , mouse cursor to go in the that line number . how go to line in richtextbox in my program ?
|
|
|
|
|
amir-haghighi wrote: . I can not good speak english . i
That's fine. I'm sure whatever language you speak natively, I can't speak as well as you speak English.
amir-haghighi wrote: how go to line in richtextbox in my program ?
You can't, because the line numbers no longer exist when your code is compiled, the code does not exist in remotely the form you created it at that time. Also, it's not possible to jump execution to a random spot in the code, even the VS debugger cannot do that, it can only jump within the current method, and within the current try block. What you're asking is basically impossible, there is no chance of you being able to do it.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Take a look at the answer in this[^] thread on MSDN.
If you ignore the bit about selecting the RichTextBox from a Tab , you should be able to work it out.
[Edit]
Just found this code:
public void GoToLineAndColumn(int Line, int Column)
{
Cursor.Current = Cursors.WaitCursor;
int Offset = 0;
int i = 0;
foreach (String L in Lines)
{
if (i < Line - 1)
{
Offset += L.Length + 1;
}
else
{
break;
}
i++;
}
Select(Offset + Column - 1, 0);
Cursor.Current = Cursors.Arrow;
}
Lines is RichTextBox.Lines property
You might also need the ScrollToCaret method, as I cannot remember if the Select(int, int) automatically brings it into view.
[/Edit]
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi all,
Could someone please tell me how to write code for the below situation?
When entering numbers into a text box
input 126 => output 1,26
input 1234 => output 12,34
It shouldn't accept letters and should allow me to leave textbox empty
Thanks in advance
|
|
|
|