|
welcome..please mark this as resolved.
|
|
|
|
|
AS i am new to this i dont know how to mark this as resolved.Can you tel?Your answer really helped me
modified 24-May-12 12:55pm.
|
|
|
|
|
The previous problem was solved...
========================================
here comes a new one
public DataView MyProperty {
get
{
return theTable.DefaultView;
}
set
{
theTable = value;
}
}
Basically what i want to do now is -
1.connect to a data base
2.Get the data and set the data set with MyProperty
3.Bind the Property with ComboBox
Final Result -> ComboBox should show all the data retreved from the data base
xaml code :
<ComboBox Height="28" HorizontalAlignment="Left" Margin="20,313,0,0" Name="comboBox3" VerticalAlignment="Top" Width="241" DataContext="{Binding Source={StaticResource deptObeject}}" ItemsSource="{Binding Path=MyProperty}" Text="{Binding Path=MyProperty.Lishan/Loc}" Style="{Binding Path=MyProperty.Lishan/Loc}" /><small></small>
|
|
|
|
|
In the main question that you posted look at the bottom you will find the resolved option
Before posting on CP first check for the solution online (google).. if you dont find it there then CP is always there........
Happy Coding
|
|
|
|
|
Hi,
I need to know if there is a feature that allows you to check the credentials to enter the email gmail.com. Basically I need an aid, urgently about how to control the existence of the username and password in the mail server.
thanks
cordially
Cristian Capannini
|
|
|
|
|
You start by creating a gmail account. Only then can you use their server to send mail.
Programming is work, it isn't finger painting. Luc Pattyn
|
|
|
|
|
Hi ,
Thank you very much for the code C# scheduler.(Anthony Roach)
In that particular code I could see the Time interval is set 60secs . Only doubt I have is that is there any chance of overlapping of the calls made through the windows service.
For example: First the service call is made, is there any chance that Second service call starts before the first call ends as the scheduling is done for 60 secs.
Thank you very much in advance.
Sateesh
|
|
|
|
|
You're better off asking this question in the article's[^] forum.
/ravi
|
|
|
|
|
I am trying to do a simple filter between two dates using a DataView. I have read that the format of the date string is important and have had good results using the ToShortDateString() method:
string filter = " (Date >= #" + Convert.ToDateTime(dateTimePicker1.Text).ToShortDateString() + "# And Date <= #" + Convert.ToDateTime(dateTimePicker2.Text).ToShortDateString() + "# ) ";
This gives the string "
filter = " (Date >= #04/05/2012# And Date <= #16/05/2012# ) "
"But, the filter reports a "String was not recognized as a valid DateTime." error if the day value is more than 12. The filtering is OK at day 12 and below.
If I change the date format the filter does not operate correctly.
My system is in en-GB culture.
The source table is a local DataTable.
Has anyone seen this type of problem?
Paul.
|
|
|
|
|
Member 1439977 wrote: Has anyone seen this type of problem?
Often; your data is in a string, formatted for a culture. You should be using a strongly typed DATE . A date is merely a number, and the computer can turn that into various culture-dependant string-representations. Next, you're putting the date into that string; it'd be best to use parameters.
SomeCommand.CommandText = @"
SELECT *
FROM Bla
WHERE SomeDate BETWEEN @StartDate AND @EndDate";
SomeCommand.Parameters.AddWithValue("@StartDate", DateTime.Now);
SomeCommand.Parameters.AddWithValue("@EndDate", DateTime.Now.AddDays(-30));
Bastard Programmer from Hell
|
|
|
|
|
You're misunderstanding: the client-side Filter property on DataView is a string, so you have no choice but to do it the 'wrong' way.
|
|
|
|
|
Ah, my apologies. You'll need this[^] syntax, and the InvariantCulture .
Bastard Programmer from Hell
|
|
|
|
|
Thanks for your reply.
I'll give that a go.
I am creating the DateTime column data from a csv file. I wonder if it is the way the csv date is formatted. it is yyyy/dd/mm.
|
|
|
|
|
two more remarks:
1. Convert.ToDateTime(dateTimePicker1.Text) is ugly and unnecessary, a DateTimePicker has a value property which gives a DateTime, there is no need to parse or convert a string here.
2. .ToShortDateString() obviously is culture dependent and therefore inappropriate in a conversation with a database which is likely to expect a culture independent format, as it possibly has to serve people and applications with diverse cultures. You could use the invariant culture, or use ToString(...) with an explicit format, say ToString("yyyy-MM-dd").
|
|
|
|
|
Thanks all for your help,
Filter working Ok now with filter:
string filter = " (Date >= #" + dateTimePicker1.Value.ToString("yyyy-MM-dd") + "# And Date <= #" + dateTimePicker2.Value.ToString("yyyy-MM-dd") + "# ) ";
A error in the sample csv file I create the date from was also causing a problem.
|
|
|
|
|
Hello.
Using Microsoft Visual Studio 2008, I try to make a graphic tool. like a photoshop.
Most of the problems were solved by using the user control.
But Several problems related to font occurred.
First, Font size!!! Separate width and height size can not be changed.
Second, Kerning!!!
I've tried hard to solve problem.
I know that my question is widely and abstract.
But my work is faced stagnant. And I do not know what to do
Please help me who know information or advice to solve problems.
Wish your help
|
|
|
|
|
Assuming this is WinForms, not WPF, you can apply a matrix transform to the graphics context, which will stretch everything in one direction:
Font font = new Font("Verdana", 12.0F);
private void myPanel_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
g.DrawString("Hello", font, Brushes.Black, 10, 10);
Matrix m = new Matrix();
m.Scale(2, 1);
g.Transform = m;
g.DrawString("Hello", font, Brushes.Black, 10, 30);
g.ResetTransform();
m = new Matrix();
m.Scale(1.5F, 1);
g.Transform = m;
g.DrawString("Hello", font, Brushes.Black, 10, 60);
g.ResetTransform();
}
I suspect that WPF could do this pretty easily (but there is a learning curve associated with WPF).
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
As mentioned before,I want to make graphic tool.
Therefore, many objects will be drawn.
some objects can cover letter's part.
example, "N" looks like "V","W" looks like "N" etc..
many problems can occur.
So I need a another method. but thanks for your comment
|
|
|
|
|
You will have to draw each letter individually. I'm not sure you can add text to a path with the .Net drawing tools, so for some of the cleverer stuff (using text as a clipping path, for example) you'd have to read the font file yourself and draw the curves.
|
|
|
|
|
An interesting article (to go along with BobJanova's comment) can be found here[^]. While it's in VB.NET, someone has provided a C# alternative in the messages.
|
|
|
|
|
Hello,
I was reading through the active directory tutorial "almost everything in active directory" but I'm not able to figure out (from it) how to query active directory for values. I'd like to query all domains based on certain attributes, log in name, last name and email address.
From that key value, I'd then like to return an array of all AD objects associated to that account.
Can anyone help me with this? I can post my code, but it doesn't work at all so it probably wouldn't be of much help. Thanks for reading.
|
|
|
|
|
What do you mean by "all AD objects associated to that account"?
|
|
|
|
|
Hi Dave,
I'd like to enter a unique identifier and get all of the account related objects for that account.
After I receive all, I can then parse through and display the ones I want in my gui. An example would be first name, last name, phone, email, any status codes/custom attributes, etc.
|
|
|
|
|
There's a problem with what you want to do.
turbosupramk3 wrote: a unique identifier
Such as??? Are you looking for everything about a User object, or are you looking for everything related to ANY kind of object in AD??
turbosupramk3 wrote: get all of the account related objects for that account.
Such as what "related objects"?? What kind of objects are you talking about?? Give an example.
turbosupramk3 wrote: An example would be first name, last name, phone, email, any status codes/custom
attributes, etc.
Those are not objects, they are Properties of a User object. Maybe you're confusing terms here?
|
|
|
|
|
I may be using the wrong terminology, if so I am sorry.
I've always called them object attributes, but I noticed in my googling that .net calls them properties which is inline with what you have said.
I would like to return all properties associated with a user object. I'll provide the GUI with a user id, last name or email, which I believe are properties named "samaccountname", "sn" and "mail", and with any of those being the unique identifier, query AD and return all other properties associated to that account into a parsable format.
|
|
|
|