|
Hi S.Dhanasekaran
thank you for your reply, I really appreciate.
Why do I have to create a DataColumn by myself? When I use SQLDataAdapter Fill() method, it does the same for me.
After using the Fill method of the SQLDataAdapter I do sth like this:
dataS = new DataSet();
...
dataS.Tables.Add(dataTable);
dataS.Tables["MyTable"].Columns["MyID"].AutoIncrement = true;
dataS.Tables["MyTable"].Columns["MyID"].AutoIncrementStep = -1;
dataS.Tables["MyTable"].Columns["MyID"].AutoIncrementSeed = 0;
dataS.Tables["MyTable"].Columns["MyID"].AutoIncrement = true;
dataS.Tables["MyTable"].Columns["MyID"].ReadOnly = true;
When i check the debugger, the AutoIncrementSeed is "-1" and the AutoIncrementStep is also "-1".
But for example, when I have now 4 rows with MyIDs = {1, 2, 3, 4} and I add manually a new row to the DataSet, the value of MyID should be -1, but it is 3.
And I have completely no clue why is that 
|
|
|
|
|
You cannot use negative numbers as the autoincrement value. Negative numbers are used by the DataAdpaters to add new records to the dataset that haven't been added to the backing database yet. The first new record you add will have an ID of -1, the next new record will be -2, and so on. Those are the temporary values used to uniquely identify each new record. They will get actual IDs once the changes are written to the database.
|
|
|
|
|
Hi Dave,
thanks for you reply.
Exactly that is what I want to achieve. I don't know the real ID values of the rows before I don't insert them to the Database. So in my case new DataTable rows are temporary and I want them to have negative ID (PrimaryKey) numbers. After I make an insert to the Database, they will receive the identity values from Database tables.
The step is negative and if I add enough rows it also gets negative, but it always starts from the last rows ID value, though I set the increment seed value to "0".
|
|
|
|
|
hi all,
what is the Difference between Button and Command button in .net
if anybody knows please reply me
Thanks in advance.
Raaj
|
|
|
|
|
Hi,
does this help you?
"The CommandButton control in Visual Basic 6.0 is replaced by the Windows Forms Button control in Visual Basic .NET"
It's from: link[^]
bye
|
|
|
|
|
|
I don't get the question. Do you mean how do you set an icon ? You create an icon file that has icons in all the sizes you need, and point to it in your project settings. Then any shortcut will have the right icon.
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.
|
|
|
|
|
I guess you want to set Icon to your Exe.
One your Solution in Visaul Studio > Project Menu > Project Properties > In Application Tab : There is an Icon and Manifest Section.
Select the Icon >Save It > Build your application again > Check the Exe Icon
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Hey... don't delete the message, if it solved, then marked it as solved.
|
|
|
|
|
Hi,
How to apply css to any controls placed inside a winform of my c# page.
|
|
|
|
|
Sorry, it can't be done.
But check out this article anyway: link[^]
|
|
|
|
|
CSS doesn't apply to Windows Forms applications at all.
|
|
|
|
|
Hi! I m a learner. What part of the code (no matter wherever in the code) acts to INTER RELATE the participating files & pages in a C# project. eg: if I add a file named new.cs to an existing project, what makes new.cs or existing files in the project know that a new comer just joined the project. Thanx
|
|
|
|
|
I would suggest that you buy a book on C# and read it, rather than trying to work everything out by the answers you get here. The answer to your question is that your files are all referred to in the csproj file, but the fact is, you needn't worry about that stuff. Worry about learning C# first. Buy a book.
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.
|
|
|
|
|
Thanx Sir, I understand the fact as already studying a C# book thats 1200 page huge & should take months+ to accomplish, therefore sometime need to seek added curricular assistance as a shortcut. Here I like to add that whether its Ok for a beginner (with no prior knowledge) to derectly start with C# without going through the preceding steps of C & C++ first. Regards
|
|
|
|
|
alrsds wrote: Here I like to add that whether its Ok for a beginner (with no prior knowledge) to derectly start with C# without going through the preceding steps of C & C++ first.
Well, obviously. I mean, C++ and C have NOTHING to do with C#, so why would you learn them first.
alrsds wrote: I understand the fact as already studying a C# book thats 1200 page huge & should take months+ to accomplish,
Sounds like you bought the wrong book, if that's 1200 pages of straight C#.
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.
|
|
|
|
|
Christian Graus wrote: Sounds like you bought the wrong book, if that's 1200 pages of straight C#.
Not necessarily, most of the content is going to be .NET rather than just C#. For example, "Professional C# 2008" is 1800+ pages, and most of teh otehrs are a similar size. I know it took me weeks to read through the first time...
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
|
|
|
|
|
My point would be that a good beginners book will provide an overview in a lot less pages, then a reference book of that size may be useful in conjunction with a winforms book.
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.
|
|
|
|
|
Well, no one does it. A cs file is only a text file, it is not "aware" of other thing in its project.
The IDE (VS or other), instead, is aware, for showing intellisense or provide refactoring. And the compiler will be aware when will be called to create an assembly from project files.
|
|
|
|
|
If you want a really good introduction to C# then look at this[^].
|
|
|
|
|
That looks good, I just glanced through the PDF, now I just need somewhere to print it...
|
|
|
|
|
PIEBALDconsult wrote: That looks good, I just glanced through the PDF, now I just need somewhere to print it...
You don't need to print it, just keep a copy on your PC so you can refer to it any time you're having trouble remembering ... anything. Time was, but that's another story.
But seriously folks, anything written by Charles Petzold has to be worth reading; and having read this document I have to say it has clarified a lot of things for me (being a bear of very little brain)!
|
|
|
|
|
Richard MacCutchan wrote: anything written by Charles Petzold has to be worth reading
And I need to print it to read it.
|
|
|
|
|
PIEBALDconsult wrote: And I need to print it to read it.
I can't afford that much paper and ink, so I use Foxit PDF reader.
BTW just scored (5s) a couple of your FAQ entries, it's always nice to stumble upon useful information.
|
|
|
|
|
Richard MacCutchan wrote: I can't afford that much paper and ink
Neither can I; that's what employers are for.
I can't read large documents on a computer. I can't read sitting up straight in one position. I prefer to get away from the computer to read.
Computers are for writing; not reading.
Richard MacCutchan wrote: just scored (5s) a couple of your FAQ entries
Thanks.
|
|
|
|