|
OriginalGriff wrote: If you must use DB assigned ints, then you can get round the problem using a stored proceedure ...
Does one really need an SP, last week I successfully used a compound command on MySQL, basically like this:
string cmd="INSERT INTO myTable (field1, field2) VALUES(@value1, @value2); SELECT last_insert_id()";
using (MySqlCommand dbCmd=new MySqlCommand(cmd, dbCon)) {
dbCmd.Parameters.Add("@value1", MySqlDbType.String).Value=value1;
dbCmd.Parameters.Add("@value2", MySqlDbType.String).Value=value2;
PK=(long)dbCmd.ExecuteScalar();
...
}
on a table with an integer auto-incrementing primary key. Are there arguments against that?
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
You don't actually need an SP to do it, but it makes it a bit more maintenance safe if you do. A new bod looking at it could easily "bleep over" the end of the insert and miss it. Plus I am not sure how SQL handles compound commands internally: could it process another command in between the two? I'd rather go with Guids and be safe every time.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
I hear what you say, FWTIW as I just read this[^].
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
OriginalGriff wrote: You are more likely to win the lottery every draw for the rest of your life than to get two matching Guids
Both the lottery and Microsoft telling you so, I'm still not sure it would be correct as it would strongly depend on the number of inserts you're performing, their frequency could be a lot higher than that of you buying a lottery ticket.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
This is true, but with a space of 3.4E38 versus 1.4E7 it's a big difference!
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
Sounds alright.
So you actually do hope to win the lottery. Good luck then.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
"It is the hope of reward that sweetens labour."
Otherwise known as "The Stupid Tax".
And, no, I'm not a Budgie Waver.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
Hi,
I am planning to develop an ERP project for Windows using Visual Studio 2008? I just wanted to know what's the way to do it? is it just one project or many projects in one Solution? or it's many Solutions?
|
|
|
|
|
It's up to you, but does depend a bit on the size of your project. If it's quite large, then multiple solutions would probably be best.
Since you haven't told use anything other than it's an ERP project, there's very little anyone can say.
|
|
|
|
|
i didn't tell anything because i am just starting
for example, it will have billing, payroll, purchase, customer details, etc...
so you still say multiple solutions is better? specially for future maintenance and improvement?
|
|
|
|
|
One always starts with one solution.
If that becomes too cluttered or too slow to build, you can always create additional solutions, add some existing and some new projects to it, and continue. Time will tell. Why worry now? I move projects from one solution to another quite regularly.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Definitely lots of smaller projects/apps.
At least if you'll make a mobile version of it such as on mobile scanners running windows CE(5 or 6 or above).
You'd want small and dedicated apps for all the major transactions.
That's my opinion.
All the best,
Dan
|
|
|
|
|
Any decent ERP is sufficiently large to need many projects at least. I'd go with one solution until it becomes more of a hassle to leave it in one place than separate it. If you are using TFS you can branch the projects out anyway, but integration can be a headache.
|
|
|
|
|
You're approaching the problem in completely the wrong way here. You're starting off with a title and a physical structure, without getting to the finer points of what your requirements actually are. That's the thing you should be looking into first - once you've sorted the requirements and your design out, then the organisation of the solution architecture should become apparent.
|
|
|
|
|
I agree. Like most applications, ERP are usually specific to the organization, so rarely(if not impossible) can you build an ERP system that has the most features that will be reused on your future projects. Like Pete said, understand the requirements before building an architecture.
Ignorance of the ability brings disability.
|
|
|
|
|
There are lots of things you have to plan before start developing.
1) What are the module you want in the ERP. (Like,- Sales, Purchase and all that).
2) Who will be your client.
3) Other requirements.
|
|
|
|
|
Are you serious? Do you know how much work is involved in developping an ERP?
|
|
|
|
|
I've spent the entire night trying to do one simple thing - populate a ListView from a DataTable and display it. That isn't asking so much, is it? From MSDN, I learned that I have to use Details view to display multiple columns containing subitems, so I tried that. In VS2010 the IDE claims that View.Details is not defined, though in Designer View I can set the View Property to Details. All examples in MSDN include the line: ListView1.View = View.Details but it doesn't exist in VS 2010. Having made the proper setting in Designer View, I set about creating something useful. Or so I thought.
What I'm trying to accomplish is to display a list of SQL Server instances on the network, and ask the user where to create a new database. Enumerating the available instances is easy, as the SqlSourceEnumerator.GetDataSources() method works great, returning a table with 4 columns of text. Using the DataTable.Columns.ColumnName() method does a nice job of populating the headers for my ListView, too. And adding ListItems and SubItems works fine, as well, as I can see the data being transferred when I step through the code using the debugger. But when it finally gets down to displaying the ListView, nothing is displayed but the headers! And even though I've set the AutoResizeColumns property to HeaderSize , they don't resize at all! My code follows, and any suggestions would be most welcome, especially if they involve sacrificing small animals - I'm in that sort of mood.
private void frmMain_Load(object sender, EventArgs e)
{
DataStuff MyData = new DataStuff();
DataTable MyTable = MyData.GetSources();
lvDataSources.HeaderStyle = ColumnHeaderStyle.Nonclickable;
lvDataSources.AutoResizeColumns((ColumnHeaderAutoResizeStyle.HeaderSize));
if (MyTable != null)
{
for (int i =0; i < MyTable.Columns.Count; i++)
{
ColumnHeader hdr = new ColumnHeader();
hdr.Text = MyTable.Columns[i].ColumnName;
lvDataSources.Columns.Add(hdr);
}
foreach (DataRow row in MyTable.Rows)
{
ListViewItem lvItem = new ListViewItem(row[0].ToString());
for (int i =1;i < MyTable.Columns.Count;i++)
{
if (row[i] != null)
lvItem.SubItems.Add(row[i].ToString());
else
lvItem.SubItems.Add("N/A");
}
}
lvDataSources.Show();
}
}
Will Rogers never met me.
|
|
|
|
|
You have missed out on adding item to the listview in the foreach loop. BTW View.Details is available to me.
Missed out on the AutoResize thing. Do it after you have added the columns and it will work.
"The worst code you'll come across is code you wrote last year.", wizardzz[ ^]
|
|
|
|
|
Bingo! How could I have missed that rather obvious step?
Note to Self: Do not stare at the same non-working code block for 6 hours straight. Walk away...
On the resizing thing, it seems to have two styles; one according to the header width, the other to match the data. What if some headers are wider than the data, and others not?
Will Rogers never met me.
|
|
|
|
|
"All examples in MSDN include the line: ListView1.View = View.Details but it doesn't exist in VS 2010."
A quick look at your code says: replace ListView1 with lvDataSources in the examples and you will be fine. All that I can see you need to do, is add the line
lvDataSources.Items.Add(lvItem);
to the bottom of your foreach loop, and it should work.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
I hate forehead slappers like that...
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
they are healthier than botox.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
I'm not too sure about that. My ears are still ringing.
Will Rogers never met me.
|
|
|
|
|
Yup, I plain missed that last step. And as d@nish pointed out, the resizing thing goes at the end. I thought it was a property for an automatic behavior, and didn't have to be explicitly called. My bad...
Thanks!
Will Rogers never met me.
|
|
|
|