|
Hello. So i have a filter that filters rows in datagridview:
private void button3_Click(object sender, EventArgs e)
{
iestadesBindingSource.Filter = string.Format("iestade_nosaukums like '%{0}%'", textBox1.Text.Trim().Replace("'", "''"));
}
When it doesn't find any records with criteria from textBox1.Text i need it to make visible label1.
|
|
|
|
|
Saidrex wrote: When it doesn't find any records with criteria from textBox1.Text i need it to make visible label1.
Where's the question? Simply check if your bindingsource contains records, and if it doesn't, hide the label.
Bastard Programmer from Hell
|
|
|
|
|
How to check if bindingsource contains records? 
|
|
|
|
|
The bindingsource will not contain records directly; you would have assigned a datasource previously. Probably a list or a datatable
Bastard Programmer from Hell
|
|
|
|
|
it contains records from my datasource which contains tables from my database. I need it to check if there is any results after filtering. Any ideas how to do it? =)
|
|
|
|
|
Saidrex wrote: Any ideas how to do it? =)
Try MSDN[^].
"The Count property gets the number of items in the underlying list represented by the List property as modified by the value of the Filter property."
Bastard Programmer from Hell
|
|
|
|
|
yay, thanks, it works, my code:
private void button3_Click(object sender, EventArgs e)
{
iestadesBindingSource.Filter = string.Format("iestade_nosaukums like '%{0}%'", textBox1.Text.Trim().Replace("'", "''"));
int a = iestadesBindingSource.Count;
if ( a == 0)
{
label1.Text = "Error. No records with this keyword.";
}
}
|
|
|
|
|
Hi All,
We develop a windows application that can deal with sql server database directly or by Web Service,
We Want to add a new dialog to our setup wizard that configure the previous settings.
2 Radio buttons-> web service, directly
2 Text Boxes-> one for Web Service Url and the other for direct sql Connection.
Please help me if you know how to do that.
Thanks All.
|
|
|
|
|
|
i try for create web setup(open-file-new-project-other project type-setup and deployment and select web setup project ) but i select project output from right click web application folder and select project output but not get any information in combo box of project so, plz guide me for create web setup in vs2008 step by step and indicate my problem
|
|
|
|
|
|
|
Dear Sirs,
I need to restrict the colours and the fontname of a control that will be displayed on a property grid.
For example, in my application I only will allow the user select on of the follow FontNames for a control in a propertygrid: {Arial, Calibri, Comic Sans MS, Arial Black, and others}.
The same will be happened with the allowed colours do be selected.
I would also know the easiest way to hide all properties, except "Size", "Location", "Font", "Backcolour", and some properties that I've created. I've learned to use Browsable(true/False), or using BrowsableAttributes. But there are some properties within an Attribute that should be hide.
Thanks,
Almerindo Paiva
|
|
|
|
|
Create a proxy; a new class that contains the properties that you want to set.
Bastard Programmer from Hell
|
|
|
|
|
Hi to all expert,
I am a beginner in C# XNA. Can I ask why is there a CROSS in my Viewport?
Thank you
|
|
|
|
|
Philip Solomon See wrote: why is there a CROSS in my Viewport?
It's become a Christian.
(Sorry, I couldn't resist...)
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
Hi Does anyone know of a good book that actually has C# Coding in it to use as a good reference book. Thanks.
|
|
|
|
|
Almost all of them, provided they do not have multiple exclamation marks, the words "for dummies" or the word "in x days" in the title.
Have a look the the Wrox[^] selection, or Addison-Wesley[^]
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
CLR via C# is a very good book if you want to spend learning more time about the internals of the .Net framework (rather than the programming language itself).
|
|
|
|
|
What I really want is a Reference Guide to the actual codings thanks
|
|
|
|
|
The MSDN C# Language Reference[^] is all you need, then. Most pages have sample code, as well.
Whew! I had to click twice - once to get to Google, and the other to get the page - to find that for you. I'm pooped... time for bed.
Will Rogers never met me.
|
|
|
|
|
I go with Abhinav, CLR via C# is still best book for me. If you do not have concept clear, example does less of purpose.
// ♫ 99 little bugs in the code,
// 99 bugs in the code
// We fix a bug, compile it again
// 101 little bugs in the code ♫
|
Tell your manager, while you code: "good, cheap or fast: pick two. "
|
|
|
|
|
Go for the Nutshell book - see my post (and the one before mine) in this thread.
/ravi
|
|
|
|
|
When this came up a month ago or so (again), I did a bit of research and found an excellent book. In fact, I bought it myself. The OP that time was looking for a book that included exercises and answers, just like a real textbook, and this one has them. The one thing it lacks, which might be a good thing for a beginner, is much coverage of data access. Although that's most of what I want to master, lengthy discussions of ADO really detract from learning the fundamentals of the language, and are better left to specialty books. It does an outstanding job of teaching the essentials of the language, and is specifically targeted for Visual Studio development for Windows. Although I've been writing functional, if not fancy, apps in C# for years, I've learned a bunch from this text, and hope to spend some quality time with it soon.
It's published by Wrox Press (unsurprising, as they produce some of the best programming books available, consistently), and entitled "Beginning Visual C# 2010." The ISBN is 978-0-470-50226-6, and it's available at Amazon. It's also dirt cheap.
Will Rogers never met me.
|
|
|
|
|
Jeffery Richter's book
Applied Microsoft.NET framework programming
CLR via C#
Best according to me...
|
|
|
|