Showing posts with label write. Show all posts
Showing posts with label write. Show all posts

Tuesday, March 27, 2012

Accessing from desktop - path not found.

Hi,
I am trying to write a desktop application using C# and .NET that can edit an SQL Server Mobile database stored on a device. The problem is no matter how I specify the data source, I get an error the path was not found. Heres the bit of the code:

string strConn = "Data Source=" + "Mobile Device\\My Documents\\Nutricom.sdf";

SqlCeConnection connDB = new SqlCeConnection(strConn);

connDB.Open();

And the error i get is..

The path is not valid. Check the directory for the database. [ Path = Mobile Device\My Documents\Nutricom.sdf ]

Everytime it thorws an error saying the path is invalid and to check the locaiton of the database. Ive tried it without the "Mobile Device" bit of the string and still nothing. The database is definately in this location.

Any help? It's driving me insane.

Lewis

You can not do that as remote SQL CE provider you have to use to accomplish that is undocumented and to be used by VS only.

Local provider you’re probably using is incapable of accessing database on device as device file system is not accessible from desktop using standard APIs.

Due to licensing restrictions you can use local desktop provider only if one of the following is true:

1. You have VS 2005 installed on this PC.

2. You have SQL Server 2005 installed on this PC.

3. Your PC is running Windows XP Tablet edition.

Assuming licensing conditions are met, you can copy data base from device using RAPI, open it with local provider, change it and copy it back to the device.

|||Hi,

Thank you for your reply.

I am using Visual Studio 2005. Just to clarify are you saying there is no way to access the database on the device WITHOUT coping it over using RAPI? or just that it is un-documented?

I have considered using RAPI and will look into it. However I have fears it may cause syncronisation issues so I would prefer to do it the first way if possible.
|||

Using remote SQL Mobile provider is undocumented and probably would violate your license.

However, there's always a way (complexity on scale from 1 to 10):

1. Map device storage to desktop drive (8).

2. Make sure application which uses database is stopped on device while desktop is changing copy of the data base (1).

3. Add remote data access capabilities to your application (3).

4. Use 3rd party tools if available (1).

I'd go with #3 as it's simple enough and has no licensing issues.

|||Hi,
Thanks again for your kind reply.

I'm afraid one again I don't fully understand sorry . I am new to programming on the. Net platform.

Number 3 sounds good to me but I don't understand what you mean by "remote data access capabilities". Is there anywhere I can find further information on this?

For anyone else wanting to do something similar I found an excellent set of libraries from OpenNETCF.org that simplify the RAPI method of coping the database tot he device and back again. I'll use them if I can't get one of the methods above working.

Lewis
|||

Basically that means what somewhere in your code you need to listen on the TCP/IP port, accepting command and data from desktop and sending requested data back. It's not related to .Net platform, concept is known for 40 years or so.

There are some 3rd part products like that:

http://www.gui-innovations.com/html/remotesqlce.html

|||

Ah thank you very very much.

At least I understand my options now.

Thanks again for your patience and help.

Lewis

|||I Still Have Problem
I receive This error message :

"The path is not valid. Check the directory for the database."
if any one solve this problem Tell me.

Thank You
mahyar
|||

I have developed some tools that may help you:

http://www.primeworks-mobile.com

Accessing from desktop - path not found.

Hi,
I am trying to write a desktop application using C# and .NET that can edit an SQL Server Mobile database stored on a device. The problem is no matter how I specify the data source, I get an error the path was not found. Heres the bit of the code:

string strConn = "Data Source=" + "Mobile Device\\My Documents\\Nutricom.sdf";

SqlCeConnection connDB = new SqlCeConnection(strConn);

connDB.Open();

And the error i get is..

The path is not valid. Check the directory for the database. [ Path = Mobile Device\My Documents\Nutricom.sdf ]

Everytime it thorws an error saying the path is invalid and to check the locaiton of the database. Ive tried it without the "Mobile Device" bit of the string and still nothing. The database is definately in this location.

Any help? It's driving me insane.

Lewis

You can not do that as remote SQL CE provider you have to use to accomplish that is undocumented and to be used by VS only.

Local provider you’re probably using is incapable of accessing database on device as device file system is not accessible from desktop using standard APIs.

Due to licensing restrictions you can use local desktop provider only if one of the following is true:

1. You have VS 2005 installed on this PC.

2. You have SQL Server 2005 installed on this PC.

3. Your PC is running Windows XP Tablet edition.

Assuming licensing conditions are met, you can copy data base from device using RAPI, open it with local provider, change it and copy it back to the device.

|||Hi,

Thank you for your reply.

I am using Visual Studio 2005. Just to clarify are you saying there is no way to access the database on the device WITHOUT coping it over using RAPI? or just that it is un-documented?

I have considered using RAPI and will look into it. However I have fears it may cause syncronisation issues so I would prefer to do it the first way if possible.
|||

Using remote SQL Mobile provider is undocumented and probably would violate your license.

However, there's always a way (complexity on scale from 1 to 10):

1. Map device storage to desktop drive (8).

2. Make sure application which uses database is stopped on device while desktop is changing copy of the data base (1).

3. Add remote data access capabilities to your application (3).

4. Use 3rd party tools if available (1).

I'd go with #3 as it's simple enough and has no licensing issues.

|||Hi,
Thanks again for your kind reply.

I'm afraid one again I don't fully understand sorry . I am new to programming on the. Net platform.

Number 3 sounds good to me but I don't understand what you mean by "remote data access capabilities". Is there anywhere I can find further information on this?

For anyone else wanting to do something similar I found an excellent set of libraries from OpenNETCF.org that simplify the RAPI method of coping the database tot he device and back again. I'll use them if I can't get one of the methods above working.

Lewis
|||

Basically that means what somewhere in your code you need to listen on the TCP/IP port, accepting command and data from desktop and sending requested data back. It's not related to .Net platform, concept is known for 40 years or so.

There are some 3rd part products like that:

http://www.gui-innovations.com/html/remotesqlce.html

|||

Ah thank you very very much.

At least I understand my options now.

Thanks again for your patience and help.

Lewis

|||I Still Have Problem
I receive This error message :

"The path is not valid. Check the directory for the database."
if any one solve this problem Tell me.

Thank You
mahyar
|||

I have developed some tools that may help you:

http://www.primeworks-mobile.com

Sunday, March 25, 2012

accessing data in different database

Hello Everyone,

Is it possible to write a query that can access data in differnt database so I have "trainee" and "training" databases. In want to access one training table in trainee database through a query. How can I do this.

Thanks.

Hi,

Yes it is possible just use database and scheme name in table name for example:

Database.scheme.tableName

select * from [trainee].[dbo].[training]

select * from [training].[dbo].[training]

both select statement should work from both databases. Be sure that user which run query have rights to access tables you use in your queries in both databases. It is also good to note in code that procedure use another database which has to exists.

Thanks

JPazgier

Tuesday, March 20, 2012

Accessing (writing into) Terdata by ado.net and SSIS

Hello everybody,

my name is Christof and I#m currently trying to write into our Terdata Warehouse by SSIS. In the Management Studio we can perfectly access Terdata - reading from it - but we actually see no way writing back Data into that system. Is there any hidden feature, any configuration menu that we had′nt seen so far?.

In the software documentation we found a tip "ADO.NET" as Data Destination is′nt imlemented for now - please wait until ....

I′m asking me if someone has had the same problem before and could help me out with a little tip.

thx in advance!

Christof

Moved to the SSIS forum. It doesn't sound like you're having a problem with ADO.NET itself, but rather how to get SSIS to do what you want, so I think this is the best place to start.

Thanks,
Sarah

Accessing (writing into) Terdata by ado.net and SSIS

Hello everybody,

my name is Christof and I#m currently trying to write into our Terdata Warehouse by SSIS. In the Management Studio we can perfectly access Terdata - reading from it - but we actually see no way writing back Data into that system. Is there any hidden feature, any configuration menu that we had′nt seen so far?.

In the software documentation we found a tip "ADO.NET" as Data Destination is′nt imlemented for now - please wait until ....

I′m asking me if someone has had the same problem before and could help me out with a little tip.

thx in advance!

Christof

Good luck with non-SQL Server destinations.

Read through here for tips: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=106559&SiteID=1

Access/SQL "Write Conflict"

Hello,
I'm using a Access 97 Front-end and a SQL Server 2000 back-end.
When entering a subform on a form, information has to be saved to the
database.
But when entering the subform I get a "Write conflict" error in Access.
In SQL I'm using 3 tables with 1 view defined on those 3 tables. I use
INSTEAD OF INSERT/UPDATE/DELETE triggers to handle
INSERTS/UPDATES/DELETES.
In Access I use that View as a Source for the form.
Does anyone know why I get this error?
Roy
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!
When I followed the execution of the code, I saw that the "Write
Conflict" error appeared after the following sub executed:
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.Dirty Then If ap_ConfirmAction(Me, apUpdate) = vbNo Then
DoCmd.RunCommand acCmdUndo
'###ROY TOEGEVOEGD VOOR GENEREREN GUID
If IsNull(Me.dummyveld) Then
Set ObjGUID = CreateObject("event.util")
GUID = ObjGUID.GetNewGUID()
Me.dummyveld = Mid(GUID, 2, 36)
Set ObjGUID = Nothing
End If
End Sub
After the "End Sub" the "Write Conflict" error pops up.
I hope someone can help me.
Roy
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!

Access/SQL "Write Conflict"

Hello,
I'm using a Access 97 Front-end and a SQL Server 2000 back-end.
When entering a subform on a form, information has to be saved to the
database.
But when entering the subform I get a "Write conflict" error in Access.
In SQL I'm using 3 tables with 1 view defined on those 3 tables. I use
INSTEAD OF INSERT/UPDATE/DELETE triggers to handle
INSERTS/UPDATES/DELETES.
In Access I use that View as a Source for the form.
Does anyone know why I get this error?
Roy
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!When I followed the execution of the code, I saw that the "Write
Conflict" error appeared after the following sub executed:
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.Dirty Then If ap_ConfirmAction(Me, apUpdate) = vbNo Then
DoCmd.RunCommand acCmdUndo
'###ROY TOEGEVOEGD VOOR GENEREREN GUID
If IsNull(Me.dummyveld) Then
Set ObjGUID = CreateObject("event.util")
GUID = ObjGUID.GetNewGUID()
Me.dummyveld = Mid(GUID, 2, 36)
Set ObjGUID = Nothing
End If
End Sub
After the "End Sub" the "Write Conflict" error pops up.
I hope someone can help me.
Roy
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!

Thursday, March 8, 2012

Access to SQL server

Hi,

I have to write an VB.NET application which imports data from an Access database to an Ms SQL server. Is there any code for this kind of task.

Thanks.

Take a look at this post

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=320478&SiteID=1

Connection string to retrieve from Access DB is as follows

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Test.mdb;"

Hope this helps

Access To SQL

Hi
I want to convert my code from access to sql, i need to know how to write the next words in SQL:
OleDbParameter
OleDbType - I got an error when i wrote SqlType.BSTR.
Thank's.You probably want to use SqlDbType.NVarChar

Access to report objects fom custom code

I can write custom code in my report through the "Report -> Properties"
dialog.
Can this code access any of the report object such as data or Custom Report
Items ?
What context is this code running under ? I tried to figure it out using
reflector and got to a dead end on a internal class called
ReportExprHostImpl.CustomCodeProxy that doesn't seem to have a reference to
anything in the report.
--
Francisco Padron
www.chartfx.comhmm...In the past what I've done is setup c# classes and just
referenced them from the report...
try this: http://msdn2.microsoft.com/en-us/library/ms155798.aspx
Hope this helps!
--
Ben Sullins
http://bensullins.com|||Unfortunatley it is not possible to access any report objects. You'll need
to pass anything you need as parameters into your functions.
"news.microsoft.com" wrote:
> I can write custom code in my report through the "Report -> Properties"
> dialog.
> Can this code access any of the report object such as data or Custom Report
> Items ?
> What context is this code running under ? I tried to figure it out using
> reflector and got to a dead end on a internal class called
> ReportExprHostImpl.CustomCodeProxy that doesn't seem to have a reference to
> anything in the report.
> --
> Francisco Padron
> www.chartfx.com
>
>

Saturday, February 25, 2012

Access SQL functions through .net?

I usually access stored procedures using SQL data source. But now I need a string returned from the database. If I write a function in SQL how do I access it from an aspx.vb file?

Put it in a proc and run an EXEC query, same way as any other procedure.

Jeff

|||

If the SQL function returns a string, why not use SqlCommand.ExecuteScalar method:

using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["myConn"].ToString()))
{
conn.Open();

string qstring = "SELECT dbo.fn_test('IORI')";

SqlCommand cmd = new SqlCommand(qstring, conn);
string s=cmd.ExecuteScalar().ToString();

Response.Write("The new string is:" + s);
}

|||Cool! Thanks guys!

Access SMO objects in CLR proc

I would like to write some CLR procs that use SMO objects. In visual studio I am unable to add refrences to the SMO objects. How can I do this?

Thanks

Bert

Because CLR was designed to work within the SQL Server engine the references available for a CLR assembly are limited. The assemblies actually run within the SQL Server context, not as operating system processes.

What would you want to do using SMO that you can't do using Transact-SQL?

|||

You are unable to add them because SMO is dependent on Batchparser90.dll which is half managed/half unmanaged code, so SQL server will not load it. They don't show up in visual studio for this reason.

If you want to use assemblies that don't show up, try creating just a normal class library and then use the CREATE ASSEMBLY T-SQL command. You will have to load all of your external assemblies as well, so I would see if they load before you start writing it, as some will and some wont.

Access SMO objects in CLR proc

I would like to write some CLR procs that use SMO objects. In visual studio I am unable to add refrences to the SMO objects. How can I do this?

Thanks

Bert

Because CLR was designed to work within the SQL Server engine the references available for a CLR assembly are limited. The assemblies actually run within the SQL Server context, not as operating system processes.

What would you want to do using SMO that you can't do using Transact-SQL?

|||

You are unable to add them because SMO is dependent on Batchparser90.dll which is half managed/half unmanaged code, so SQL server will not load it. They don't show up in visual studio for this reason.

If you want to use assemblies that don't show up, try creating just a normal class library and then use the CREATE ASSEMBLY T-SQL command. You will have to load all of your external assemblies as well, so I would see if they load before you start writing it, as some will and some wont.

Saturday, February 11, 2012

Access denied to the access path !....ReportManager\bin

Hello
I write url Http://Servidor/Reports and present problem
Access denied to the Path C:\Archivos de programa\Microsoft SQL
Server\MSSQL\Reporting Services\ReportManager\bin".
Check the permisos and the user ASP.Net have Full acces
Thanks
HernanDid you checked the log file for the reportmanager and event log ?
"Hernan Arboleda" wrote:
> Hello
> I write url Http://Servidor/Reports and present problem
> Access denied to the Path C:\Archivos de programa\Microsoft SQL
> Server\MSSQL\Reporting Services\ReportManager\bin".
> Check the permisos and the user ASP.Net have Full acces
> Thanks
> Hernan
>
>