 |
|
 |
It doesn't look like this has been updated recently. Does anyone know if there's something like this that supports multiple result sets returned from the stored procedure and table valued parameters?
|
|
|
|
 |
|
 |
I have evaluated many ORM modellers and code generators over the years, none of them gave me the code I wanted. Over the last few years in my spare time I have created my own stored procedure and C# code generator.
The generator is very intuitive to use and generates CRUD stored procedures, Data Components, Business components and Business Entities. The generated code uses SqlDataReaders for it's data retrieval and no reflection.
It will even generate a n-Unit test project.
Caching support is available through business objects as well as IoC for Data Components.
Performance benchmarks comparing it to the ADO.NET Entity Framework and Linq to SQL can be found on the site.
Find it here http://www.elencysolutions.co.uk
|
|
|
|
 |
|
 |
I have a particular problem:
Imagine the following scenario:
I have a search button that will launch a SP.Invoke ... I've added code to this project where you can actually set Sql Command Timeout parameter in run-time.
What I want is to be able to cancel that SP.Invoke if another search is made.
At the moment, a SP.Invoke can go for too long, and it will block the correspondent dataset, and no new requests will be made. This results in problems: if an user performs a search (sp.invoke) with parameters that will make the query long enough, no new searchs will be made till that first sp.invokes get's back from the sql server (which can takes hours).
What i what is to be able to release that invokation (and therefore release the correspondent dataset), as in Sp.CancelInvoke (which, of course, does not exist), so that if an user presses search (one sp.Invoke) then press search again, the first sp.invoke gets canceled and another can be made.
Any thoughts on this?
Thx for your attention,
Gonçalo
|
|
|
|
 |
|
 |
This is a very good codegen !
But! I think there is a possibility to slightly increase performance. To do this it is necessary to initialize commands and parameters once a time, not each time when I call Invoke method.
|
|
|
|
 |
|
 |
I am using Visual Studio 2003 and C#. The stored procedure is a simply insert in oracle. Thanks a lot.
|
|
|
|
 |
|
 |
SP/Invoke worked great on MSVS2003 (.Net 1.1), no problems.
However, when I recently moved my project to .NET 2.0, the compiler could not find the SP/Invoke tool for the XML ("Custom tool not found on system").
I compiled the SPInvoke project on MSVS2005 and re"regasm"ed it, but it did not help as well.
Did anyone manage to use this project on .NET 2.0 or had my problem and fixed it?
Please help, thanks
|
|
|
|
 |
|
 |
Hi Simon. I can't get you on the email address supplied in this article so I'm posting in the discussion area here.
I've just been fortunate enough to stumble across your SPInvoke app (whilst looking for something completely unrelated). Isn't it always the way with CodeProject? Anyway, it's a great little design you have, I congratulate you. I plan to introduce it into our dev process.
We use VS2005 and SQL2005 and I've just gone through the app and replaced all the deprecated code. In case you haven't done this yourself, I will happily return the converted app back to you by way of thanks, if you want it (so long as you accept that it's not been fully tested as yet)
Additionally, I have used the app slightly differently from your published instructions. I don't know if this applies to earlier versions of VS but in VS2005 you can specify custom build tool for a given file extension. So, instead of leaving the source files as .XML I simply called them .SPI and set up SPInvoke as the build tool. Now I just add an XML file, save it as say MyFile.SPI and I can skip setting up the Custom Tool property. There are some additional registry entries that are needed to get the tool working under VS2005 so I have these too if you want them.
I also plan (at some point) to modify it to use a VS DB connection instead of the having the settings in the XML file itself. This would make it a little more robust when sharing projects in a team environment.
If you want all this info, I can bundle it up and send it to you. I won't clutter your inbox with this stuff if you've already done it though.
Many Thanks
---------
~swg
|
|
|
|
 |
|
 |
Hi SWG
I saw yor reply t hte original post. what you did and planned on doing is what i was hoping to find. I would love to see the changes you have made to the original code along with the reg entries...
I was wondering it you could share it with us.
Thanks
SC.
|
|
|
|
 |
|
 |
I would love a copy of the 2.0 version of spinvoke! Any chance?
DTrent
|
|
|
|
 |
|
 |
In the row classes there is code like the following:
reader.GetValue(1)
Is there anyway to configure to use column names like
reader["ColumnName"] within these generated classes?
I am asking because I have some stored procs that use SELECT * FROM TABLE
and I have to change the column orders some times when adding indexes, etc. which breaks the spinvoke generated class.
|
|
|
|
 |
|
 |
Ok, I solved this problem by building my own version where it uses indexers with a column name in the code generation for the rowclasses. I was also wondering how you embed the schema in the resx file in case I want to mod or add some options?
|
|
|
|
 |
|
 |
Hi ;
I use Access Data Base and and I need Vb code to validate if the data in field is in UTF-8 or not .
Thank's for your help
regards
|
|
|
|
 |
|
 |
Has anyone made this?
I've setup the XML file's custom tool property, and created the databse and a sample stored procedure, but it's not generating the code... may be SQL 2005 changed a lot so this isn't working anymore?
daniero
|
|
|
|
 |
|
 |
Below is link of Lattice.SPGen, a stored procedure generator which support Oracle, SQL Server, and IBM DB2 UDB, Lattice.SPGen can generate business entity class in both C# and VB.net as well.
http://www.latticesoft.com
|
|
|
|
 |
|
 |
A while ago, I searched the internet for a code generator of stored procedures with simple feactures:
- No further modification to the generated code
- Synchronizing with procedure changes
- Directly interacting with data provider methods
- Flexible for effecient use of ADO.Net functionality
- Static data binding
- SQL Server, OleDb, ODBC, Oracle, MySQL data providers
There are a lot of such kind but I had no success.
Now, I have created one and if you are interested, take a look at
http://www.povb.com/posharp
Chris Liang
|
|
|
|
 |
|
 |
... or just use one of the many free tools like MyGeneration :
www.mygenerationsoftware.com
Kind regards,
thomas
People who wait until the eleventh hour to call on Jesus die at 10:30.
|
|
|
|
 |
|
 |
If suppose we have store procedure as follows
CREATE PROCEDURE dbo.GetCount
(
@country varchar(11),
@Count int OUTPUT
)
AS
SET NOCOUNT ON
Select @Count = count(customerid) from customers
where country = @country
RETURN
GO
How do we use this tool for the above kind of stored procedure?
GetCount.Result result = GetCount.Invoke(conn, "USA", ref count);
Tha above usage gives me an error message
Thanks in advance
|
|
|
|
 |
|
 |
Ideally the custom tool should auto generate the XML file with all stored procedures from a given database. (just a thought)
Oliver
|
|
|
|
 |
|
 |
hi
i wan to ask how does this program run ?? does this program need any other things in order to run this program code?
when i run the code in visual studio.net it prompt me the following error:-
1)
Program 'C:\Documents and Settings\ipcl\Desktop\denise work folder\SPInvoke\Visual Studio .NET 2003\SPInvoke\obj\Debug\SPInvoke.exe' does not have an entry point defined
2)
C:\Documents and Settings\ipcl\Desktop\denise work folder\SPInvoke\Visual Studio .NET 2003\SPInvoke\StoredProcedures.xml The custom tool 'objectnation.SPInvoke' failed. SQL Server does not exist or access denied.
can any plz help me .
thanx alot
denise
|
|
|
|
 |
|
 |
The documentation included with SP/Invoke contains detailed instructions on how to use it from within Visual Studio .NET.
|
|
|
|
 |
|
 |
my procedure inserts a record and ends with
"return select @@IDENTITY"
now logic would dictate that the returnvalue of my object would have that identity in it, but it doesn't. why?
|
|
|
|
 |
|
 |
First of all I would like to say how amazing this tool is. Great job.
Is it possible to return multiple tables in one stored procedure call?
-- Objectnation xml
<storedProcedureClass source="spReturn2Tables" access="public">
<rowClass />
</storedProcedureClass>
--DB
Create PROCEDURE [dbo].[spReturn2Tables]
AS
select * from table1
Select * from table2
GO
When I use the above code only the fisrt table is returned as a strong typed object.
Thanks
David
|
|
|
|
 |
|
 |
Hi David
I'm afraid that this isn't currently possible. Modifying the generated code to extract from multiple tables wouldn't be very difficult. However, extending the tool's internal meta-data structures to describe multiple result sets would require a good deal of thought and is therefore something that will probably have to wait for the next major release.
We don't currently know when the next release will be completed but I doubt it will be before the end of the year - sorry...
Best regards,
Simon Wilson
|
|
|
|
 |
|
 |
This tool is very cool. There is one feature that I would like included and that is to allow the attribute access="internal" within the <storedProcedureClass> element to generate classes with internal access.
|
|
|
|
 |
|
 |
You can use the access attribute on the storedProcedureClass element to specify the access individually for that stored procedure class. See section 8.4 in the documentation.
|
|
|
|
 |