Showing posts with label missing. Show all posts
Showing posts with label missing. Show all posts

Friday, March 23, 2012

Help on how to 1 way push data

Hi there
Maybe Im missing something but..
I have a order tracking system running on sales peoples laptop's. When they connect to the company Network (via dialup) at Night I want to push all off there orders to a named SQL, and then remove those orders from their own laptop.
So in a sense, Its like a one way merge with a delete, or even a push from MSDE to the main SQL server.
I dont want existing data pushed back to the laptop.. SO its all one way.
Any ideas? or help
Ryan,
I have seen merge used for this - you can have a filter of 1=2 on the
tables. This ensures that subscriber inserts are replicated to teh
publisher, and then deletes are replicated back because the filter is not
satisfied. However, this can be a bit buggy if inserts are still carried out
on the subscriber while the merge agent is running (some of the new rows
won't be removed when next running the merge agent). Provided you can
prevent this, or it won't happen in your particular business, then this is a
viable solution.
Alternatively, each laptop could be configured as a transactional publisher
with HO as a central subscriber and for the delete command, 'none' is
entered to prevent the replication of deletes.
Finally, you could use DTS/linked servers to accomplish the same thing.
Regards,
Paul Ibison
|||Hi Paul
Thanks for your reply. Could you just explain the
> you can have a filter of 1=2 on the
> tables. This ensures that subscriber inserts are replicated to teh
> publisher, and then deletes are replicated back because the filter is not
> satisfied.
please as this sounds about the right way - as the users will not be adding new records at the time of syncronisation (they are basically using the Win Xp Syncronisation tool i.e. Annonymous.
|||Ryan,
in the filter section of the publication properties, on the filter rows tab
you specify this filter:
SELECT <published_columns> FROM [dbo].[yourtable] WHERE 2=1
HTH,
Paul Ibison

Friday, February 24, 2012

Help me resolve this error."Missing parameter field current value." Code Attach

Hi ,
am getting this error."Missing parameter field current value." When i Use this line of code
crReportDocument.DataDefinition.ParameterFields.ApplyCurrentValues() it says "ApplyCurrentValues is not a member of CrystalDecisions.CrystalReports.Engine.ParameterFieldDefinition".How do i get rid of this error.
Also is there anyway that without Exporting , i Can Print the Report from vb.net application directly using default Printer.
Code is:
Private Sub Btn_Export_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn_Export.Click
Try
Dim ConnInfo As New ConnectionInfo
With ConnInfo
.ServerName = "WASA00150"
.DatabaseName = "iCalls"
.UserID = "sa"
.Password = "courage"
End With
Me.CrystalReportViewer1.ParameterFieldInfo.Clear()
If Me.txtSTdate.Text.Trim.Length > 0 Then
Me.CrystalReportViewer1.ReportSource = Server.MapPath("iCalls_CrystalReport_Department.rpt")
Dim ParamFields As ParameterFields = Me.CrystalReportViewer1.ParameterFieldInfo
Dim Per As New ParameterField
Per.ParameterFieldName = "Period"
Dim Period_Value As New ParameterRangeValue
Period_Value.StartValue = Me.txtSTdate.Text
Period_Value.EndValue = Me.txtCLdate.Text
Per.CurrentValues.Add(Period_Value)
ParamFields.Add(Per)
End If
For Each cnInfo As TableLogOnInfo In Me.CrystalReportViewer1.LogOnInfo
cnInfo.ConnectionInfo = ConnInfo
Next
Me.CrystalReportViewer1.RefreshReport()
CrystalReportViewer1.Visible = True
Dim exportPath As String = "D:\SampleCrystalReports\iCalls_Export\test1.pdf"
Dim crExportOptions As ExportOptions
Dim crDestOptions As New DiskFileDestinationOptions
crDestOptions.DiskFileName = exportPath
crExportOptions = crReportDocument.ExportOptions
crExportOptions.DestinationOptions = crDestOptions
crExportOptions.ExportDestinationType = ExportDestinationType.DiskFile
crExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat
'crReportDocument.DataDefinition.ParameterFields.ApplyCurrentValues()
crReportDocument.Export()
Catch ex As Exception
lblmsg.Text = ex.Message.ToString
End Try
End Sub
Many Thanks.Not sure if this is it, but looking at the code this line.

'crReportDocument.DataDefinition.ParameterFields.ApplyCurrentValues()

has a ' at the begining, is that supposed to be there ?

Help Me Please!! Im Having Dts Troubles!!

Can anybody help me with this?

I'm trying to update three fields in one table from an import table. Is the anything you see missing in my code:

Dim rs1, strSQL

strSQL = "Select safety_valve_cap, hydro_date, hydro_psi, state_No From HBC_ZImport"
set rs1 = objConn.Execute(strSQL)

Do While NOT rs1.EOF

strSQL = "Update HBC_Boiler_Inspection set Safety_Valve_Cap = '" & rs1 ("Safety_Valve_Cap") & "', "
strSQL = strSQL & " Hydro_PSI = '" & rs1 ("Hydro_PSI") & "', "
strSQL = strSQL & " Hydro_Date = '" & rs1 ("Hydro_Date") & "' "
strSQL = strSQL & " where Boiler_ID = (Select ID from HBC_Boiler where State_No = ' " & rs1 ( "State_No") & " ') & " ' "
objConn.Execute(strSQL)

rs1.MoveNext()
Loop

Function Main()
Main = DTSTaskExecResult_Success
End FunctionSome things I noted:

1. Move the Function Main() statement to the top
2. Dim objConn
3. Instantiate objConn and rs1
4. Set the connection string for objConn
5. Open objConn

I did not see anything glaringly wrong with the SQL, but I did not focus on that.

The rewritten code would look like:

Function Main()

Dim rs1, strSQL, objConn

set objConn = CreateObject("ADODB.Connection")
set rs1 = CreateObject("ADODB.RecordSet")

objConn.ConnectionString = {insert your connection string here}
objConn.Open

strSQL = "Select safety_valve_cap, hydro_date, hydro_psi, state_No From HBC_ZImport"
set rs1 = objConn.Execute(strSQL)

Do While NOT rs1.EOF

strSQL = "Update HBC_Boiler_Inspection set Safety_Valve_Cap = '" & rs1 ("Safety_Valve_Cap") & "', "
strSQL = strSQL & " Hydro_PSI = '" & rs1 ("Hydro_PSI") & "', "
strSQL = strSQL & " Hydro_Date = '" & rs1 ("Hydro_Date") & "' "
strSQL = strSQL & " where Boiler_ID = (Select ID from HBC_Boiler where State_No = ' " & rs1 ( "State_No") & " ') & " ' "
objConn.Execute(strSQL)

rs1.MoveNext

Loop

Main = DTSTaskExecResult_Success

End Function

HTH,

Hugh Scott

Originally posted by Bigced_21
Can anybody help me with this?

I'm trying to update three fields in one table from an import table. Is the anything you see missing in my code:

Dim rs1, strSQL

strSQL = "Select safety_valve_cap, hydro_date, hydro_psi, state_No From HBC_ZImport"
set rs1 = objConn.Execute(strSQL)

Do While NOT rs1.EOF

strSQL = "Update HBC_Boiler_Inspection set Safety_Valve_Cap = '" & rs1 ("Safety_Valve_Cap") & "', "
strSQL = strSQL & " Hydro_PSI = '" & rs1 ("Hydro_PSI") & "', "
strSQL = strSQL & " Hydro_Date = '" & rs1 ("Hydro_Date") & "' "
strSQL = strSQL & " where Boiler_ID = (Select ID from HBC_Boiler where State_No = ' " & rs1 ( "State_No") & " ') & " ' "
objConn.Execute(strSQL)

rs1.MoveNext()
Loop

Function Main()
Main = DTSTaskExecResult_Success
End Function