|
sureyyan wrote: and let dataadapter automatically do all these database
Theres you first mistake, don't rely on the data adapter to do anything automatically, you are the programmer, understand what your program is doing, take control of your data and its manipulation. The biggest problem I can see here is new programmers relying on the MS wizards to do the work they should be doing with a data access layer (DAL). Do some research into DAL, stored procedures and parameterised queries, you will be a better developer for it!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Keep your advises and assumptions to yourself.
Use your time for something constructive and behave yourself.
|
|
|
|
|
That's a bit of an arsey attitude you've got going on there - a newbie and obnoxious; that's an attractive package you've got going there bubba. You were given good advice, but you wilfully chose to ignore it and attack the person giving it - perhaps you need to step back for a moment, and think about the advice you've been given and consider that those of us who do this professionally might actually have a lot more of a clue than you.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
sureyyan wrote: Keep your advises and assumptions to yourself
Not a problem, YOU sort it out, I did many years ago.
You see had you come back with something along the lines of "What do you suggest" there would have been no end of links to articles to help you learn a more robust way of dealing with data.
As to my assumptions they are based on the quality of the question which indicates a newbie with no depth of knowledge beyond the first brush with the MS wizards. The advice I gave you was valid, you need to get past the built in wizard stuff and gain a deeper understanding of the data.
Now you have proven yourself to be both a newbie and rude, note the votes and the amount of support you received.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
"Never underestimate the power of human stupidity"
"Never underestimate the power of arrogance without a class"
|
|
|
|
|
Hear hear!
The DataAdapter and DataGrid(View) were developed simply to demonstrate how easy data access with ADO.net can be.
They should never be used in a production application.
CommandBuilder, upon which DataAdapter relies, is very limited in its abilities; it can't generate commands to update multiple joined tables.
|
|
|
|
|
Well, this is really interesting.
can you please advice which control to use instead of DataGrid/View in production envoirnment?
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
Something designed specifically for the data in question.
|
|
|
|
|
well, If i wanna show collection of data to the user the same as tables, do I need use DataGird/View or there is some other control for that?
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
Thank you for your kind reply,
I'have been doing application with so many years, I just wanted to understand why and how one should use commandbuilder under a given circumstances, as a new user of c#. I saw similar issues with joined tables and multiple table updates, which I offcourse did database operations on sql handle basis. My question was actually, to see different views if in complicated applications is there any use for such tools. I'have been using gupta for so many years, there things are much structural and robust.
Thanks for your info
|
|
|
|
|
sureyyan wrote: how one should use commandbuilder
Don't; it's too limited. There's no substitute for hand-rolled data access code.
|
|
|
|
|
I agree with your command builder comment.can you please give a small example of how you populate a table, if not with dataadapter.
|
|
|
|
|
Hello friends,
I am trying to annotate some functions on screen and open documents (like internet explorer, word, or any pdf that is opened on the desktop)using some paint applications like pen, brush and highlighter. In simple words I want to paint directly on the desktop using some draw tools like pencil, brush etc. I saw some programs in code projects and got some idea but I am unable to move further. Also I saw a program that actually does this called screen painter. Unfortunately it is in c++. So can any body help me in doing this in c#.
Thanking you in advance,
Kind regards,
Vijay (vijay_varma86@yahoo.com)
|
|
|
|
|
bumping is rude
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Do not repeat your post because you do not have a reply. All you will do is annoy poeple. It is a Sunday, so Europe, the US and Australia are not at work, generally. You may get a better reponse tomorrow.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
|
For Win Forms you could use MaskedTextBox.Similar control is available for ASP.NET with Ajax toolkit too.
Life is a stage and we are all actors!
|
|
|
|
|
Yes i use it by windows forms. but how can i make it like the picture?
not with a code with the settings
|
|
|
|
|
Did you ask google how?
Life is a stage and we are all actors!
|
|
|
|
|
Hello friends,
I am trying to annotate some functions on screen and open documents (like internet explorer, word, or any pdf that is opened on the desktop)using some paint applications like pen, brush and highlighter. In simple words I want to paint diretly on the desktop using some draw tools like pencil, brush etc. I saw some programs in code projects and got some idea but I am unable to move further. Also I saw a program that actually does this called screen painter. Unfortunately it is in c++. So can any body help me in doing this in c#.
Thanking you in advance,
Kind regards,
Vijay (vijay_varma86@yahoo.com)
|
|
|
|
|
{<br />
private static int count;<br />
public StaticDataMembersAndMethods()<br />
{<br />
InitializeComponent();<br />
count++;<br />
<br />
}<br />
public void showcount()<br />
{<br />
MessageBox.Show("Value of count is :" + count);<br />
}<br />
<br />
<br />
private void button1_Click(object sender, EventArgs e)<br />
{<br />
StaticDataMembersAndMethods objstatic = new StaticDataMembersAndMethods();<br />
objstatic.showcount();<br />
<br />
<br />
}<br />
how to get additions starting from zero? now it starts with number two.
|
|
|
|
|
{
private static int count;
public StaticDataMembersAndMethods()
{
InitializeComponent();
count++;
}
public void showcount()
{
MessageBox.Show("Value of count is :" + count);
}
private void button1_Click(object sender, EventArgs e)
{
StaticDataMembersAndMethods objstatic = new StaticDataMembersAndMethods();
objstatic.showcount();
}
There are a couple of things here, that you need to understand.
Firstly, it is bad practise to declare a variable, and use it before it is initiialised. You do this with "count" - you declare it "private static int count;" and then increment it in teh class constructor "count++". You get away with this because it is an int, and the framework initialized it for you, to zero. If you try this with a string, you will get an exception when you try to append to it. Declare you int as "private static int count = 0;"
Secondly, the count does allready start at zero, not two. What is happening is that you do not understand what a static variable is. When you declare a variable (or a method) as static, you are saying that there is only one instance of this variable - it is shared in common between all instances of the class.
So, you have a class called "StaticDataMembersAndMethods" which is derived from a Form (since the constructor contains a "InitializeComponent" call), which contains a static variable "count", and a button "Button1". When the form is constucted, count is created and initialized by the framework to zero. The class constructor is called, and increments the count to one. The button press then creates a second instance of the class, which shares the existing instance of the static count. The constructor for the class is called, which increments the count to two. The MessageBox then shows that.
Oh, please use <pre></pre> tags to surround you code fragments; it displays it as shown above which is a lot easier to read - particularly when the fragment gets bigger.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Black Gen wrote: how to get additions starting from zero? now it starts with number two.
How many times did you call StaticDataMembersAndMethods()?
you coud add function to set count
because it is static all instance of StaticDataMembersAndMethods have same count. If one changes, in all instance are affected
|
|
|
|
|
Hello every one,
I am using the following code to add items to my listview
I have PNG icons 16x 16 with transparency ,
unfortunately the icons as a result of this code look really bad in the listvirew.
looks like it is not getting the transparency of the the image,
PLease help,
thanks in advacne..
Ahmed
ImageList imList = new ImageList();
Image img = new System.Drawing.Bitmap(@"D:\Resources\PNG\User.png");
imList.Images.Add(img);
listViewUsers.SmallImageList = imList;
foreach (MItem mItem in items)
{
this.listViewUsers.Items.Add("hello world", "hello world", 0);
}
Ahmed
|
|
|
|
|
It is not your ListView that is the problem but the ImageList . This is a well known problem and it is disgusting IMNSHO that M$ have not fixed this huge bug by .NET 3.5!
My rant doesn't help you though, so take a look at this CP article Adding and using 32 bit alphablended images and icons to the imagelist control[^] to see if it helps you understand what is happening.
If that is no help try Googling on C# imagelist transparency. You will get loads and loads of hits.
Good luck!
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.”
|
|
|
|