Showing posts with label thru. Show all posts
Showing posts with label thru. Show all posts

Monday, February 13, 2012

ADO and the RowID

I am trying to update a SQL db record with ADO commands from an asp page thru a stored proc using the RowID and it is not working. RowID is the Identity seed record.

Here is the stored proc:

CREATE PROCEDURE [sp_Update_tblECMTimeTrackingMain]
@.RowID int,
@.StartTime datetime,
@.EndTime datetime,
@.TransxStatus varchar(50)
AS
Begin
UPDATE [tblECMTimeTrackingMain]
SET FStartTime = @.StartTime,
FEndTime = @.EndTime,
TransxStatus = @.TransxStatus
where RowID = @.RowID
End
GO

Here is the asp/ado code:

set cmdINSERT = Server.CreateObject("ADODB.command") cmdINSERT.ActiveConnection = strCONN_DATA cmdINSERT.CommandText = "[sp_Update_tblECMTimeTrackingMain]" cmdINSERT.CommandType = 4

set param = cmdINSERT.CreateParameter("@.RowID",3,1,4) cmdINSERT.Parameters.Append param

set param = cmdINSERT.CreateParameter("@.FStartTime",135,1,8) cmdINSERT.Parameters.Append param

set param = cmdINSERT.CreateParameter("@.FEndTime",135,1,8) cmdINSERT.Parameters.Append param

set param = cmdINSERT.CreateParameter("@.TransxStatus",129,1,50) cmdINSERT.Parameters.Append param

cmdINSERT.Parameters(0) = CInt(mACTREFNUM) ...when I change this to "568" it actually does the update. Yes there is something in mACTREFNUM.

cmdINSERT.Parameters(1) = meStartTime

cmdINSERT.Parameters(2) = meEndTime

cmdINSERT.Parameters(3) = meStatus

cmdINSERT.Execute lngRECS,,128

Any clues?

Is there any indication as to what, if any, error is happening? What value is stored in mACTREFNUM and can you verify that the result of CInt(mACTREFNUM) is, in fact, an integer value?

Thanks,

Jason

ADO and the RowID

I am trying to update a SQL db record with ADO commands from an asp page thru a stored proc using the RowID and it is not working. RowID is the Identity seed record.

Here is the stored proc:

CREATE PROCEDURE [sp_Update_tblECMTimeTrackingMain]
@.RowID int,
@.StartTime datetime,
@.EndTime datetime,
@.TransxStatus varchar(50)
AS
Begin
UPDATE [tblECMTimeTrackingMain]
SET FStartTime = @.StartTime,
FEndTime = @.EndTime,
TransxStatus = @.TransxStatus
where RowID = @.RowID
End
GO

Here is the asp/ado code:

set cmdINSERT = Server.CreateObject("ADODB.command") cmdINSERT.ActiveConnection = strCONN_DATA cmdINSERT.CommandText = "[sp_Update_tblECMTimeTrackingMain]" cmdINSERT.CommandType = 4

set param = cmdINSERT.CreateParameter("@.RowID",3,1,4) cmdINSERT.Parameters.Append param

set param = cmdINSERT.CreateParameter("@.FStartTime",135,1,8) cmdINSERT.Parameters.Append param

set param = cmdINSERT.CreateParameter("@.FEndTime",135,1,8) cmdINSERT.Parameters.Append param

set param = cmdINSERT.CreateParameter("@.TransxStatus",129,1,50) cmdINSERT.Parameters.Append param

cmdINSERT.Parameters(0) = CInt(mACTREFNUM) ...when I change this to "568" it actually does the update. Yes there is something in mACTREFNUM.

cmdINSERT.Parameters(1) = meStartTime

cmdINSERT.Parameters(2) = meEndTime

cmdINSERT.Parameters(3) = meStatus

cmdINSERT.Execute lngRECS,,128

Any clues?

Is there any indication as to what, if any, error is happening? What value is stored in mACTREFNUM and can you verify that the result of CInt(mACTREFNUM) is, in fact, an integer value?

Thanks,

Jason

Sunday, February 12, 2012

ADO

Hi:

Is it true that a .net project of WinCE 5.0 pro can't access Win2000 SQL database thru ADO?

Any solution?

Chang

ADO.Net CE actually has a different forum. I'll move the thread over there.|||

no, not true. A .NET Compact Framework 1.0 or 2.0 project running on WinCE5 can indeed access a SQL Server 2000 database directly using the version of the SqlClient included with the COmpact Framework.

Darren

|||

Thank you Darren:

Can you give me the address to download the version of the SqlClient included with the COmpact Framework?

My purpose is to use a WinCE mobil computer to run a .net program and real time access my SQL2000. Someone suggest me to use sqlCE to sychronize with SQL2000? or use webservice but neither of these way were workable, I don't know what's wrong.

Jeanet

|||

If you are developing a Smart Device project in Visual Studio 2005, all you need to do to work with SQL Server 2000 using the SqlClient is add a reference to your project to System.Data.SqlClient version 3.0.3600.0. The SqlClient comes as part of the .NET Compact Framework, which is included with versions of Visual Studio that are capable of doing Smart Device projects (VSTS Developer, VS2005 Professional, etc).

In general, you should only be using SqlClient if you are reliably connected (WinCe device to server) during database operations. As this is often impossible to guarantee, most people use a local data cache on device (SQL CE or SQL Mobile are the common choices) and periodically synchronize data between the server and local data cache when a connection is available. A newsgroup is not the place to teach you how to implement this, but any of the books on the .NET Compact Framework cover this topic and the new Mobile Client Software Factory provides a reference implementation. http://msdn.microsoft.com/mobility/default.aspx?pull=/library/en-us/dnpag2/html/mcsflp.asp

Darren

|||

Thank you Darren:

I'm new to work with WinCE. My purpose is to use a handheld (Symbol 3090 running WinCE 5.0) to run a simple application (a .net 2005 program) over RF connection to real time access my SQL server.

I need clear instructions to setup the environment.

Your answer will be very appreciaated.

Jeanet