Tuesday, March 27, 2012
@@error in vb6
How can I read the value of @.@.error from within vb6 source? Or how can I check the success of a transaction (comit/rollback) from within vb6 frontend source?
Thank you!I believe you will have to pass it back as an output parameter from your stored procedure. That's how I do it anyway.|||To capture @.@.error you can either store its value into an output parameter, or return it in the form of a result set.
To trap an execution error and notify your FE of a specific section of BE code that encountered the error use RAISERROR. In your VB code precede the call to SQL with ON ERROR (either RESUME NEXT and check for error right below, or GOTO <LABEL> and do the error trapping there).
EDITED: At the end make sure to turn error-fall-through OFF by issueing ON ERROR GOTO 0. Failure to do so often yields hours of debugging.|||ON ERROR GOTO 0. Failure to do so often yields hours of debugging.
Couldn't agree more. That's why I don't use it. Way too many sleepless nights trying to figure out why the stupid app isn't giving me the results I expect.
On Error Goto BeerFridge
Now that works :)
Sunday, March 11, 2012
.NET Provider for SAP and variables
Hi,
I am using .NET Provider for SAP to import data from SAP BW to the SQL-Server 2005.
The OLE-DB source has an sql command like this
"exec Z_SQL_EXPORT @.I_WEEK_FROM='200601', @.I_WEEK_TO='200602'
I want to make this command more flexible by using a variable strWEEK_FROM and strWEEK_TO.
How can I do this?
Thank you for yout help.
Gerd
Two methods, expressions or OLE-DB parameters.
You can use a ? as the placeholder, so like this -
exec Z_SQL_EXPORT @.I_WEEK_FROM=?, @.I_WEEK_TO=?
Then go to the parameters dialog in the source and map the variables to the placholders.
This is a better method, I think, more secure for a start, but does not always work due to what the parameter is or the OLE-DB provider.
or
Create a variable and set EvaluateAsExpression to true.
Set the expression on the variable to build the string you require, perhaps something like this, but do some proper date formatting -
"exec zsqlexport @.week = '" + (DT_WSTR, 10)@.[Varname] + "'"
Change the source query type to be SQL Command from variable.
|||Thanks DarrenSQLIS for your answer.
I found similar informations on other web-sites.
When I try to use your first possibility and click OK in the dialog box then I receive the response
"Error in data-flow-task: An error occured...".
How can I "map the variables to the placholders"?
Then I treid the second solution, but with the oledb-data-provider for sap I found no possibibilty to change the source type to SQL command from variable.
Can you help me again?
Thanks.
Gerd.
|||Sorry, my mistake. The SAP provider is a ADO.Net managed provider, so of course you use the DataReader Source which does not have the same options as the OLE-DB Source.
There is no parameter support, but you can use an expression. Rather than using a variable, you can set a property expression actually on the SqlCommand property for the DataReader source.
To set an expression a component property (not all component properties upport though however), you need to be in the context of the data flow. Either select the task in Control View, or just click on a clean area of the Data Flow design surface, and then look at the Properties grid, showing the properties of that task. Now select Expressions from the properties grid. You can then select the SqlCommand property for the instance of the data reader source you wish to work against.
|||Thanks again,
this works!
For those who have a similar problem, I found an article that give a detailled description on how to work with datareader expressions and sqlcommand:
http://www.vsteamsystemcentral.com/cs/blogs/applied_team_system/archive/2006/5/7.aspx
Thursday, March 8, 2012
.Net Data Provider for Teradata
Does the .net data provider for Teradata work the same way as the ole db provider for Teradata? I have created a data source using the .net provider and verified the connection to Teradata but when I go through the data source view wizard it will not bring back a list of tables/views and appears to just sit idle.
Thanks.
I experienced the same problem with a self-developed .NET provider foranother
database while creating a data source view in BI Development
Studio:
A connection to the database is established without any problems. Then the
application just queries the provider's data source information table and that's all.
It does not even try to query the tables in the database.
Is this a known bug in SSAS 2005?|||
I also found this where the tables/views were not shown.
If you click Next to accept an empty Data Source View screen I found that you can then add tables/view by right-click on the DSV screen and click on 'New Named Query'. Name the table and add you SQL to extract from the Teradata table (you can click the small arrow icon to run the query or click OK to return to the DSV and then use 'Explore Data'.
I have used this as a workaround until someone comes up with a better answer.
.Net Data Provider for Teradata
Does the .net data provider for Teradata work the same way as the ole db provider for Teradata? I have created a data source using the .net provider and verified the connection to Teradata but when I go through the data source view wizard it will not bring back a list of tables/views and appears to just sit idle.
Thanks.
I experienced the same problem with a self-developed .NET provider for anotherdatabase while creating a data source view in BI Development Studio:
A connection to the database is established without any problems. Then the
application just queries the provider's data source information table and that's all.
It does not even try to query the tables in the database.
Is this a known bug in SSAS 2005?|||
I also found this where the tables/views were not shown.
If you click Next to accept an empty Data Source View screen I found that you can then add tables/view by right-click on the DSV screen and click on 'New Named Query'. Name the table and add you SQL to extract from the Teradata table (you can click the small arrow icon to run the query or click OK to return to the DSV and then use 'Explore Data'.
I have used this as a workaround until someone comes up with a better answer.
.Net Data Provider for Teradata
Does the .net data provider for Teradata work the same way as the ole db provider for Teradata? I have created a data source using the .net provider and verified the connection to Teradata but when I go through the data source view wizard it will not bring back a list of tables/views and appears to just sit idle.
Thanks.
I experienced the same problem with a self-developed .NET provider foranother
database while creating a data source view in BI Development
Studio:
A connection to the database is established without any problems. Then the
application just queries the provider's data source information table and that's all.
It does not even try to query the tables in the database.
Is this a known bug in SSAS 2005?|||
I also found this where the tables/views were not shown.
If you click Next to accept an empty Data Source View screen I found that you can then add tables/view by right-click on the DSV screen and click on 'New Named Query'. Name the table and add you SQL to extract from the Teradata table (you can click the small arrow icon to run the query or click OK to return to the DSV and then use 'Explore Data'.
I have used this as a workaround until someone comes up with a better answer.
.net data provider / Data processing extention
I found some samples, but I'm unable to do anything with it.
There are some source code files in the knowledge base. But I don't know how
to apply the Instruction on compile them.
I need realy step by step instructions for a novice. A hint for a good book
would be ok too.
(I'm wonder about the jumbs between gradients in all the documentation and
articles. Example: Open Visual Studio, select ..., to add a class do..., then
implement correct marshaling, use all the named pipes correct, find and
implement Windows APIs and thats realy all, just doit! References: Blind link
Nr 1; Blind link Nr 2; ...)There is a section in msdn describing process of creating a data extension:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rsamples/htm/rss_sampleapps_v1_16g2.asp
There is also a sample that is shipped with RS:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rsamples/htm/rss_sampleapps_v1_8spu.asp
I will work with you thru the steps. Let's start with trying to compile and
run the sample.
Let me know where you get the first problem.
--
Alex Mineev
Software Design Engineer. Report expressions; Code Access Security; Xml;
SQE.
This posting is provided "AS IS" with no warranties, and confers no rights
"Dev Main" <DevMain@.discussions.microsoft.com> wrote in message
news:F2E68AC2-DEFE-4593-A3AE-FD6FF3CB93F2@.microsoft.com...
> Is there somewhere a real usable sample application for this?
> I found some samples, but I'm unable to do anything with it.
> There are some source code files in the knowledge base. But I don't know
how
> to apply the Instruction on compile them.
> I need realy step by step instructions for a novice. A hint for a good
book
> would be ok too.
> (I'm wonder about the jumbs between gradients in all the documentation and
> articles. Example: Open Visual Studio, select ..., to add a class do...,
then
> implement correct marshaling, use all the named pipes correct, find and
> implement Windows APIs and thats realy all, just doit! References: Blind
link
> Nr 1; Blind link Nr 2; ...)|||Thank you very much!!!
This seems to be a good tip. I try it on monday and post a feedback.
"Alexandre Mineev [MSFT]" wrote:
> There is a section in msdn describing process of creating a data extension:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rsamples/htm/rss_sampleapps_v1_16g2.asp
> There is also a sample that is shipped with RS:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rsamples/htm/rss_sampleapps_v1_8spu.asp
> I will work with you thru the steps. Let's start with trying to compile and
> run the sample.
> Let me know where you get the first problem.
> --
> Alex Mineev
> Software Design Engineer. Report expressions; Code Access Security; Xml;
> SQE.
> This posting is provided "AS IS" with no warranties, and confers no rights
> "Dev Main" <DevMain@.discussions.microsoft.com> wrote in message
> news:F2E68AC2-DEFE-4593-A3AE-FD6FF3CB93F2@.microsoft.com...
> > Is there somewhere a real usable sample application for this?
> > I found some samples, but I'm unable to do anything with it.
> >
> > There are some source code files in the knowledge base. But I don't know
> how
> > to apply the Instruction on compile them.
> >
> > I need realy step by step instructions for a novice. A hint for a good
> book
> > would be ok too.
> >
> > (I'm wonder about the jumbs between gradients in all the documentation and
> > articles. Example: Open Visual Studio, select ..., to add a class do...,
> then
> > implement correct marshaling, use all the named pipes correct, find and
> > implement Windows APIs and thats realy all, just doit! References: Blind
> link
> > Nr 1; Blind link Nr 2; ...)
>
>|||Now I know the steps required to deploy the assembly. That's an part of the
whole way.
It is still to much for me to get this transfered so I can create a
Dataprovider for a connection to a Oracle database.
I found an article about .net dataprovider with sample files for all classes
(it's called DotNetDataProviderTemplate). I found no way to get this sample
compiled and runing. Although I'm not try to implement the reporting services
interface.
I created a new Project and added all the sample .vb files. But compile this
seems to be imposible, what ever I'm doing. Error are "Type '...' not
defiened and classes are ambiguous. But the Types are defined and the
classenames are unique.
If I would overcome all immediate barriers, I don't know how to set
permission to access a oracle database. I recognized that it is necessary to
set permission. But documented is only SQL Server, not oracle.
I'm using allways VB, a VB Sample would be great. But if the sample is
complete enough C# will be ok too. It seems, that C# is easy to understand.
If no oracle sample is available a complete sample to access a SQL Server
database will be also good.
Thank you for your effort.
"Alexandre Mineev [MSFT]" wrote:
> There is a section in msdn describing process of creating a data extension:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rsamples/htm/rss_sampleapps_v1_16g2.asp
> There is also a sample that is shipped with RS:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rsamples/htm/rss_sampleapps_v1_8spu.asp
> I will work with you thru the steps. Let's start with trying to compile and
> run the sample.
> Let me know where you get the first problem.
> --
> Alex Mineev
> Software Design Engineer. Report expressions; Code Access Security; Xml;
> SQE.
> This posting is provided "AS IS" with no warranties, and confers no rights
> "Dev Main" <DevMain@.discussions.microsoft.com> wrote in message
> news:F2E68AC2-DEFE-4593-A3AE-FD6FF3CB93F2@.microsoft.com...
> > Is there somewhere a real usable sample application for this?
> > I found some samples, but I'm unable to do anything with it.
> >
> > There are some source code files in the knowledge base. But I don't know
> how
> > to apply the Instruction on compile them.
> >
> > I need realy step by step instructions for a novice. A hint for a good
> book
> > would be ok too.
> >
> > (I'm wonder about the jumbs between gradients in all the documentation and
> > articles. Example: Open Visual Studio, select ..., to add a class do...,
> then
> > implement correct marshaling, use all the named pipes correct, find and
> > implement Windows APIs and thats realy all, just doit! References: Blind
> link
> > Nr 1; Blind link Nr 2; ...)
>
>|||Implementing RS IDbConnection, IDbCommand etc interfaces is easier than full
interfaces defined in System.Data.
The "type not found" errors are probably coming for RS interfaces. You need
to copy two dlls from reportserver/bin:
Microsoft.ReportingServices.Interfaces and ...DataExtensions.dll and you
need to add references to both of the dlls to your project
--
Alex Mineev
Software Design Engineer. Report expressions; Code Access Security; Xml;
SQE.
This posting is provided "AS IS" with no warranties, and confers no rights
"Dev Main" <DevMain@.discussions.microsoft.com> wrote in message
news:33E43A47-1654-4879-9590-0FEE8BF911BC@.microsoft.com...
> Now I know the steps required to deploy the assembly. That's an part of
the
> whole way.
> It is still to much for me to get this transfered so I can create a
> Dataprovider for a connection to a Oracle database.
> I found an article about .net dataprovider with sample files for all
classes
> (it's called DotNetDataProviderTemplate). I found no way to get this
sample
> compiled and runing. Although I'm not try to implement the reporting
services
> interface.
> I created a new Project and added all the sample .vb files. But compile
this
> seems to be imposible, what ever I'm doing. Error are "Type '...' not
> defiened and classes are ambiguous. But the Types are defined and the
> classenames are unique.
> If I would overcome all immediate barriers, I don't know how to set
> permission to access a oracle database. I recognized that it is necessary
to
> set permission. But documented is only SQL Server, not oracle.
> I'm using allways VB, a VB Sample would be great. But if the sample is
> complete enough C# will be ok too. It seems, that C# is easy to
understand.
> If no oracle sample is available a complete sample to access a SQL Server
> database will be also good.
> Thank you for your effort.
>
> "Alexandre Mineev [MSFT]" wrote:
> > There is a section in msdn describing process of creating a data
extension:
> >
> >
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rsamples/htm/rss_sampleapps_v1_16g2.asp
> >
> > There is also a sample that is shipped with RS:
> >
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rsamples/htm/rss_sampleapps_v1_8spu.asp
> >
> > I will work with you thru the steps. Let's start with trying to compile
and
> > run the sample.
> > Let me know where you get the first problem.
> >
> > --
> > Alex Mineev
> > Software Design Engineer. Report expressions; Code Access Security; Xml;
> > SQE.
> >
> > This posting is provided "AS IS" with no warranties, and confers no
rights
> >
> > "Dev Main" <DevMain@.discussions.microsoft.com> wrote in message
> > news:F2E68AC2-DEFE-4593-A3AE-FD6FF3CB93F2@.microsoft.com...
> > > Is there somewhere a real usable sample application for this?
> > > I found some samples, but I'm unable to do anything with it.
> > >
> > > There are some source code files in the knowledge base. But I don't
know
> > how
> > > to apply the Instruction on compile them.
> > >
> > > I need realy step by step instructions for a novice. A hint for a good
> > book
> > > would be ok too.
> > >
> > > (I'm wonder about the jumbs between gradients in all the documentation
and
> > > articles. Example: Open Visual Studio, select ..., to add a class
do...,
> > then
> > > implement correct marshaling, use all the named pipes correct, find
and
> > > implement Windows APIs and thats realy all, just doit! References:
Blind
> > link
> > > Nr 1; Blind link Nr 2; ...)
> >
> >
> >|||Thank you, but somehow it doesn't work, wath ever I try.
What exactly must be written in:
Public Sub Open() Implements IDbConnection.Open
to open the connection to database?
As mentioned in my first post I'm a novice in .net and reporting services
too. Something very simple must be wrong. And I only find help like you must
implement ...Interface. But I can't find how to do this exactly.
"Alexandre Mineev [MSFT]" wrote:
> Implementing RS IDbConnection, IDbCommand etc interfaces is easier than full
> interfaces defined in System.Data.
> The "type not found" errors are probably coming for RS interfaces. You need
> to copy two dlls from reportserver/bin:
> Microsoft.ReportingServices.Interfaces and ...DataExtensions.dll and you
> need to add references to both of the dlls to your project
> --
> Alex Mineev
> Software Design Engineer. Report expressions; Code Access Security; Xml;
> SQE.
> This posting is provided "AS IS" with no warranties, and confers no rights
> "Dev Main" <DevMain@.discussions.microsoft.com> wrote in message
> news:33E43A47-1654-4879-9590-0FEE8BF911BC@.microsoft.com...
> > Now I know the steps required to deploy the assembly. That's an part of
> the
> > whole way.
> >
> > It is still to much for me to get this transfered so I can create a
> > Dataprovider for a connection to a Oracle database.
> >
> > I found an article about .net dataprovider with sample files for all
> classes
> > (it's called DotNetDataProviderTemplate). I found no way to get this
> sample
> > compiled and runing. Although I'm not try to implement the reporting
> services
> > interface.
> > I created a new Project and added all the sample .vb files. But compile
> this
> > seems to be imposible, what ever I'm doing. Error are "Type '...' not
> > defiened and classes are ambiguous. But the Types are defined and the
> > classenames are unique.
> >
> > If I would overcome all immediate barriers, I don't know how to set
> > permission to access a oracle database. I recognized that it is necessary
> to
> > set permission. But documented is only SQL Server, not oracle.
> >
> > I'm using allways VB, a VB Sample would be great. But if the sample is
> > complete enough C# will be ok too. It seems, that C# is easy to
> understand.
> > If no oracle sample is available a complete sample to access a SQL Server
> > database will be also good.
> >
> > Thank you for your effort.
> >
> >
> > "Alexandre Mineev [MSFT]" wrote:
> >
> > > There is a section in msdn describing process of creating a data
> extension:
> > >
> > >
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rsamples/htm/rss_sampleapps_v1_16g2.asp
> > >
> > > There is also a sample that is shipped with RS:
> > >
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rsamples/htm/rss_sampleapps_v1_8spu.asp
> > >
> > > I will work with you thru the steps. Let's start with trying to compile
> and
> > > run the sample.
> > > Let me know where you get the first problem.
> > >
> > > --
> > > Alex Mineev
> > > Software Design Engineer. Report expressions; Code Access Security; Xml;
> > > SQE.
> > >
> > > This posting is provided "AS IS" with no warranties, and confers no
> rights
> > >
> > > "Dev Main" <DevMain@.discussions.microsoft.com> wrote in message
> > > news:F2E68AC2-DEFE-4593-A3AE-FD6FF3CB93F2@.microsoft.com...
> > > > Is there somewhere a real usable sample application for this?
> > > > I found some samples, but I'm unable to do anything with it.
> > > >
> > > > There are some source code files in the knowledge base. But I don't
> know
> > > how
> > > > to apply the Instruction on compile them.
> > > >
> > > > I need realy step by step instructions for a novice. A hint for a good
> > > book
> > > > would be ok too.
> > > >
> > > > (I'm wonder about the jumbs between gradients in all the documentation
> and
> > > > articles. Example: Open Visual Studio, select ..., to add a class
> do...,
> > > then
> > > > implement correct marshaling, use all the named pipes correct, find
> and
> > > > implement Windows APIs and thats realy all, just doit! References:
> Blind
> > > link
> > > > Nr 1; Blind link Nr 2; ...)
> > >
> > >
> > >
>
>
Tuesday, March 6, 2012
.Net custom resolver
custom resolver written in .Net (C, VB etc dont mind which)?
I just need the skeletion of it and not the actually implementation of the
conflict resolution.
cheers
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"msnews.microsoft.com" <nospam_nige66_@.hotmail.nospam> wrote in message
news:%23nNkqybcFHA.1556@.TK2MSFTNGP10.phx.gbl...
> Can anyone point me towards a source code listing for a working
replication
> custom resolver written in .Net (C, VB etc dont mind which)?
> I just need the skeletion of it and not the actually implementation of the
> conflict resolution.
> cheers
>
|||Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"msnews.microsoft.com" <nospam_nige66_@.hotmail.nospam> wrote in message
news:%23nNkqybcFHA.1556@.TK2MSFTNGP10.phx.gbl...
> Can anyone point me towards a source code listing for a working
replication
> custom resolver written in .Net (C, VB etc dont mind which)?
> I just need the skeletion of it and not the actually implementation of the
> conflict resolution.
> cheers
>
|||Try chapter 30 from the resource kit. You can get it online at
http://www.microsoft.com/resources/d...rt8/c3061.mspx
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"msnews.microsoft.com" <nospam_nige66_@.hotmail.nospam> wrote in message
news:%23nNkqybcFHA.1556@.TK2MSFTNGP10.phx.gbl...
> Can anyone point me towards a source code listing for a working
replication
> custom resolver written in .Net (C, VB etc dont mind which)?
> I just need the skeletion of it and not the actually implementation of the
> conflict resolution.
> cheers
>
|||Been there.... its only covers vb (not dotnet) and no sample code either
(the samples from SQL devtools are old vb - again not in even in dotnet)
I'm *really* after an experienced developer who has done SQL with
replication and has some code as BOL, RK, Google etc has turned up nothing
of use
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:eSqhs6bcFHA.3504@.TK2MSFTNGP12.phx.gbl...
> Try chapter 30 from the resource kit. You can get it online at
> http://www.microsoft.com/resources/d...rt8/c3061.mspx
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
> "msnews.microsoft.com" <nospam_nige66_@.hotmail.nospam> wrote in message
> news:%23nNkqybcFHA.1556@.TK2MSFTNGP10.phx.gbl...
> replication
>
|||But you must use COM, the merge replication subsystem doesn't understand
anything else - even in SQL 2005 it still (from my reading of the
documentation) uses COM.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"msnews.microsoft.com" <nospam_nige66_@.hotmail.nospam> wrote in message
news:%239nYDNccFHA.2768@.tk2msftngp13.phx.gbl...[vbcol=seagreen]
> Been there.... its only covers vb (not dotnet) and no sample code either
> (the samples from SQL devtools are old vb - again not in even in dotnet)
> I'm *really* after an experienced developer who has done SQL with
> replication and has some code as BOL, RK, Google etc has turned up nothing
> of use
>
> "Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
> news:eSqhs6bcFHA.3504@.TK2MSFTNGP12.phx.gbl...
http://www.microsoft.com/resources/d...rt8/c3061.mspx
>
|||Exactly - but I need a resolver written in dotnet (so I can call managed
code) but need it to expose itself as com for SQL. The more I'm reading it
does seem to me that again the next version of SQL is not the major upgrade
that it should be. I'm all for backward compatibility but it would be nice
if we could take a step forward without nailing one foot to floor.
Still on the look out for a solution for what is a really simple problem -
the lines of code I want to call amount to probably no more than 5 yet SQL
seems to hinder at every turn - perhaps I should swap out the database
backend from SQL and use Exchange instead ;-)
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:%23%23VjOGecFHA.2520@.TK2MSFTNGP09.phx.gbl...
> But you must use COM, the merge replication subsystem doesn't understand
> anything else - even in SQL 2005 it still (from my reading of the
> documentation) uses COM.
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
> "msnews.microsoft.com" <nospam_nige66_@.hotmail.nospam> wrote in message
> news:%239nYDNccFHA.2768@.tk2msftngp13.phx.gbl...
> http://www.microsoft.com/resources/d...rt8/c3061.mspx
>
|||All you have to do is creating a COM component that implements the
ICustomResolver interface. Make sure you have selected the 'Register for COM
interop' setting in the project-properties in Visual Studio. And you have to
use the regasm utility.
good luck,
Marco
// just a small example:
using System;
using System.Runtime.InteropServices;
using SQLResolver;
using System.Data;
using System.Xml;
namespace ReplicationConflictResolver
{
[GuidAttribute("12877204-7044-4abc-9833-3B839427972C")]
public class ThisConflictResolver : ICustomResolver
{
public ThisConflictResolver()
{
}
#region ICustomResolver Members
public void Reconcile(IReplRowChange pRowChange, int dwFlags,
IReplRowChange pvReserved)
{
// Determine the type of change condition
REPOLE_CHANGE_TYPE changeType;
pRowChange.GetChangeType(out changeType);
// Handle the conflict
switch (changeType)
{
case REPOLE_CHANGE_TYPE.REPOLEChange_DownloadDeleteFail ed:
{
// Handle this particular conflict, by rollbacking the change
pRowChange.DoDummyUpdate(REPOLE_BOOL.REPOLEBool_TR UE,
REPOLE_BOOL.REPOLEBool_FALSE);
}
case .......
}
public void GetHandledStates(ref int ResolverBm)
{
ResolverBm = (int) (REPOLE_CHANGE_TYPE.REPOLEAllConflicts |
REPOLE_CHANGE_TYPE.REPOLEAllErrors );
}
#endregion
}
}
"msnews.microsoft.com" wrote:
> Can anyone point me towards a source code listing for a working replication
> custom resolver written in .Net (C, VB etc dont mind which)?
> I just need the skeletion of it and not the actually implementation of the
> conflict resolution.
> cheers
>
>
Saturday, February 25, 2012
.MDF DataBase
I was using: Microsoft Access Database File as Data Source of my Data Connection, because my Database was created in Microsoft Access (so it has an .mdb extenstion).
But I read that SQL Server has feature-rich than Access Server, as you know SQL Server use .mdf files extension.
So,How can I create a .mdf database ??Can I convert a .mdb database to .mdf ??
Thanks
Hi,
SQL Server is more advanced than Access and you can download SQL Server 2005 Express edition for free. In order to change the exisitng MDB database to SQL Server, you need to import it in SQL Server. Merely renaming file extensions will not work as both data engines are inherently different.
Hope this helps,
Vivek
|||Hellovivek_iit ,
Thank you for replay .. I was downloading SQL Server Express Edition on my computer ..
Ok , but can you tell me step by step how could I import the .mdb database to SQL Server.
I am waiting for your next replay .
Have a nice day.
|||
Hi,
The process is somewhat reverse in SQL Server Express Edition (as it does not have any import functionality like SQL Server 2005). First create an ODBC connection to your SQL Server express edition database. Next, open you Access database,select your Tables, right click and chooseExportfrom the menu. In the resulting window, select the Sql Server Express Edition database ODBC connection you created.
Hope this helps,
Vivek
|||You can also use the upsizing wizard in Access... Tools> Database Utilites> Upsizing Wizard. I have used this on occasion at it seems to work ok...
|||
Hello again ,
I did it, Looooolz
Thank youvivek_iit for your help
Thank yousayitfast ,it is very easy step to flow it and fast.
Have a nice day.
Saturday, February 11, 2012
(urgent) Help needed for this insert statement
Hi,
I am trying to insert the Source name and clientId to a table called clientSource...
The User will send in some Dbf File... So in a particular file called PlanDbf.. I have the following fields
PlanNumber, Name, SRC1Name, SRC2Name, SRC3Name... SRC20Name
170234 Constructions Employee Deferral Employer Discretionary Employer Matching...
And in another table called SourceDBF i have the following fields with data
PlanNumber PARTID SOURCE_NUM etc...
170234 123456789 1
170234 123456789 3
170234 451231334 1
So how do i match the Source_NUM with SRCnames when i insert it into the table..
INSERT INTO Statement..ClientSource
(
@.ClientId,
SourceName
)
SELECT
s.SOURCE_NUM
FROM SourceDBF ..
but i am stuck..
any help will be appreciated.
Regards
Karen
I cant see a connection between them. How are they related?
|||
The 2 tables are related by the plan number...
and will know by taking a look at the PlanDBF if its 1 then to pull ... SRC1Name...
|||Sorry I still cant get it.. can you just post few rows from each tables and expected output so its easier to understand (at least for me)..
|||this is how the table that i need to insert is ...
SourceId (int identity) ClientID SourceName
And i will be getting the Data the source name from the Table...
PlanDBF (which has one row of data)
PlanNumber, Name, SRC1Name, SRC2Name, SRC3Name... SRC20Name
170234 Constructions Employee Deferral Employer Discretionary Employer Matching...
and then once i insert the data to the above table called source.. I am inserting the data from the Source Summary which is as follows
PlanNumber PartId Source_NUM begbal dep withdrawels etc..
to another table ParticipantSourceSummary which has the has the follow fields
Plan Number PartId SourceId (which will be got from the clientSource table) and the remaining fields from the SourceSummary table
So at the end while i generate a report i want Source_NUm 1 to be whats in SRCName and so on
Hope this is clear.
Regards
Karen
|||CREATE VIEW vw_Sources AS
SELECT PlanNumber,Src1Name AS SourceName,1 AS Source_Num
FROM PlanDBF
UNION ALL
SELECT PlanNumber,Src2Name AS SourceName,2 AS Source_Num
FROM PlanDBF
UNION ALL
SELECT PlanNumber,Src3Name AS SourceName,3 AS Source_Num
FROM PlanDBF
{repeat 17 more times}
--
Not sure of all your relations, but then you can do something like this:
SELECT s.PlanNumber,s.PartID,s.Source_Num,vw_Sources.SourceName
FROM SourceDBF s
JOIN vw_Sources ON s.PlanNumber=vw_Sources.PlanNumber AND s.SOURCE_NUM=vw_Sources.SOURCE_NUM
|||Alternatively, you can do this:
SELECT s.PlanNUmber,s.PartID,s.Source_Num,
(SELECT CASE s.Source_Num WHEN 1 THEN Src1Name WHEN 2 THEN Src2Name WHEN 3 THEN Src3Name ... END FROM PlanDBF p WHERE p.PlanNumber=s.PlanNumber) AS SourceName
FROM SourceDBF
|||Motley,
Thanks a lot.. the solution works for me
Regards,
Karen