Sunday, March 11, 2012

Yet another designer issue

SAL,
What code are you using to add the parameters?
Kerry Moorman
"SAL" wrote:
> Bill,
> Thanks for helping with my last designer issue. Now, I execute the following
> query in the Query Builder and it returns one record:
> SELECT
> ReportedWeeds.RID, Weeds.Name, ReportedWeeds.Density, BioAgents.BName,
> ReportedWeeds.Assr_SN, ReportedWeeds.TownRange, ReportedWeeds.LotSize,
> ReportedWeeds.theDate, ROW.[Desc] AS RDesc, ReportedWeeds.Owner,
> ReportedWeeds.OwnStAddrs, ReportedWeeds.OwnCity, ReportedWeeds.OwnState,
> ReportedWeeds.OwnZip, ReportedWeeds.OwnPhone, MethodContacted.[Desc] AS
> MDesc, ReportedWeeds.SitusHsnbr + ' ' + ReportedWeeds.SitusStDir + ' ' +
> ReportedWeeds.SitusStName + ' ' + ReportedWeeds.SitusSType + ' ' +
> ReportedWeeds.SitusCity AS SITADDRS, ReportedWeeds.Source,
> ReportedWeeds.SourceCity, ReportedWeeds.SourceState,
> ReportedWeeds.SourceStDir,
> ReportedWeeds.SourceHsnbr, ReportedWeeds.SourceStName,
> ReportedWeeds.SourceZip, ReportedWeeds.SourcePhone,
> ReportedWeeds.Comments, ReportedWeeds.FollowUp, ReportedWeeds.FollowUpNotes,
> ReportedWeeds.Atlas
> FROM ((((ReportedWeeds LEFT OUTER JOIN
> ROW ON ReportedWeeds.ROWID = ROW.ROWID) LEFT OUTER JOIN
> Weeds ON ReportedWeeds.WID = Weeds.WID) LEFT OUTER JOIN
> MethodContacted ON ReportedWeeds.MCID = MethodContacted.MCID) LEFT OUTER
> JOIN
> BioAgents ON ReportedWeeds.BioAgent = BioAgents.BAID)
> WHERE (ReportedWeeds.Source LIKE '%' + ? + '%') AND (ReportedWeeds.theDate
> >= ?) AND (ReportedWeeds.theDate <= ?)
> I pass in the following as parameters:
> Palmer
> 1/1/2006
> 12/31/2006
> But, when I execute this same query through the TableAdapter (that was
> created via the designer), it returns an error:
> The provider could not determine the Double value. For example, the row was
> just created, the default for the Double column was not available, and the
> consumer had not yet set a new Double value.
> When I was getting this error before, it was because the SITADDRS column as
> type Double. But, that error went away when I set the type as a string as it
> should have been.
> Can anyone help with this maybe?
> S
>
>
Hi Kerry,
I have a business logic layer class that I'm using. Here's the code for this
querry:
Public Function GetWeedReportsBySourceDate(ByVal source As String, ByVal
year As Integer) As WeedRptds.ReportedWeedsDataTable
Dim startDate, endDate As Date
Dim rwdt As WeedRptds.ReportedWeedsDataTable = Nothing
startDate = Date.Parse("01/01/" & year.ToString())
endDate = Date.Parse("12/31/" & year.ToString())
Try
rwdt = Adapter.GetWeedReportsBySourceDate(source, startDate,
endDate)
Catch ex As Exception
Console.WriteLine(ex.Message)
End Try
Return rwdt
End Function
The class' Adapter property is:
Imports WeedRptdsTableAdapters ' imports the table adapters for the
class
Private mReportedWeeds As ReportedWeedsTableAdapter
Public ReadOnly Property Adapter() As ReportedWeedsTableAdapter
Get
If mReportedWeeds Is Nothing Then
mReportedWeeds = New ReportedWeedsTableAdapter
End If
Return mReportedWeeds
End Get
End Property
S
"Kerry Moorman" <KerryMoorman@.discussions.microsoft.com> wrote in message
news:31560669-53BB-42FE-8308-40D131D09C40@.microsoft.com...
> SAL,
> What code are you using to add the parameters?
> Kerry Moorman
>
> "SAL" wrote:
>> Bill,
>> Thanks for helping with my last designer issue. Now, I execute the
>> following
>> query in the Query Builder and it returns one record:
>> SELECT
>> ReportedWeeds.RID, Weeds.Name, ReportedWeeds.Density,
>> BioAgents.BName,
>> ReportedWeeds.Assr_SN, ReportedWeeds.TownRange, ReportedWeeds.LotSize,
>> ReportedWeeds.theDate, ROW.[Desc] AS RDesc, ReportedWeeds.Owner,
>> ReportedWeeds.OwnStAddrs, ReportedWeeds.OwnCity, ReportedWeeds.OwnState,
>> ReportedWeeds.OwnZip, ReportedWeeds.OwnPhone, MethodContacted.[Desc] AS
>> MDesc, ReportedWeeds.SitusHsnbr + ' ' + ReportedWeeds.SitusStDir + ' ' +
>> ReportedWeeds.SitusStName + ' ' + ReportedWeeds.SitusSType + ' ' +
>> ReportedWeeds.SitusCity AS SITADDRS, ReportedWeeds.Source,
>> ReportedWeeds.SourceCity, ReportedWeeds.SourceState,
>> ReportedWeeds.SourceStDir,
>> ReportedWeeds.SourceHsnbr, ReportedWeeds.SourceStName,
>> ReportedWeeds.SourceZip, ReportedWeeds.SourcePhone,
>> ReportedWeeds.Comments, ReportedWeeds.FollowUp,
>> ReportedWeeds.FollowUpNotes,
>> ReportedWeeds.Atlas
>> FROM ((((ReportedWeeds LEFT OUTER JOIN
>> ROW ON ReportedWeeds.ROWID = ROW.ROWID) LEFT OUTER JOIN
>> Weeds ON ReportedWeeds.WID = Weeds.WID) LEFT OUTER JOIN
>> MethodContacted ON ReportedWeeds.MCID = MethodContacted.MCID) LEFT OUTER
>> JOIN
>> BioAgents ON ReportedWeeds.BioAgent = BioAgents.BAID)
>> WHERE (ReportedWeeds.Source LIKE '%' + ? + '%') AND
>> (ReportedWeeds.theDate
>> >= ?) AND (ReportedWeeds.theDate <= ?)
>> I pass in the following as parameters:
>> Palmer
>> 1/1/2006
>> 12/31/2006
>> But, when I execute this same query through the TableAdapter (that was
>> created via the designer), it returns an error:
>> The provider could not determine the Double value. For example, the row
>> was
>> just created, the default for the Double column was not available, and
>> the
>> consumer had not yet set a new Double value.
>> When I was getting this error before, it was because the SITADDRS column
>> as
>> type Double. But, that error went away when I set the type as a string as
>> it
>> should have been.
>> Can anyone help with this maybe?
>> S
>>
I've found the field that's causing the problem but seems goofy ntl:
if the concatenated field for SITADDRS as follows:
ReportedWeeds.SitusHsnbr + ' ' + ReportedWeeds.SitusStDir + ' ' +
ReportedWeeds.SitusStName + ' ' + ReportedWeeds.SitusSType + ' ' +
ReportedWeeds.SitusCity AS SITADDRS
If I remove this field from the query, it runs properly.
Anybody got any ideas on this?
S
"SAL" <SAL_@.NoNo.com> wrote in message
news:%23J%23mY7udHHA.2128@.TK2MSFTNGP04.phx.gbl...
> Bill,
> Thanks for helping with my last designer issue. Now, I execute the
> following query in the Query Builder and it returns one record:
> SELECT
> ReportedWeeds.RID, Weeds.Name, ReportedWeeds.Density, BioAgents.BName,
> ReportedWeeds.Assr_SN, ReportedWeeds.TownRange, ReportedWeeds.LotSize,
> ReportedWeeds.theDate, ROW.[Desc] AS RDesc, ReportedWeeds.Owner,
> ReportedWeeds.OwnStAddrs, ReportedWeeds.OwnCity, ReportedWeeds.OwnState,
> ReportedWeeds.OwnZip, ReportedWeeds.OwnPhone, MethodContacted.[Desc] AS
> MDesc, ReportedWeeds.SitusHsnbr + ' ' + ReportedWeeds.SitusStDir + ' ' +
> ReportedWeeds.SitusStName + ' ' + ReportedWeeds.SitusSType + ' ' +
> ReportedWeeds.SitusCity AS SITADDRS, ReportedWeeds.Source,
> ReportedWeeds.SourceCity, ReportedWeeds.SourceState,
> ReportedWeeds.SourceStDir,
> ReportedWeeds.SourceHsnbr, ReportedWeeds.SourceStName,
> ReportedWeeds.SourceZip, ReportedWeeds.SourcePhone,
> ReportedWeeds.Comments, ReportedWeeds.FollowUp,
> ReportedWeeds.FollowUpNotes, ReportedWeeds.Atlas
> FROM ((((ReportedWeeds LEFT OUTER JOIN
> ROW ON ReportedWeeds.ROWID = ROW.ROWID) LEFT OUTER JOIN
> Weeds ON ReportedWeeds.WID = Weeds.WID) LEFT OUTER JOIN
> MethodContacted ON ReportedWeeds.MCID = MethodContacted.MCID) LEFT OUTER
> JOIN
> BioAgents ON ReportedWeeds.BioAgent = BioAgents.BAID)
> WHERE (ReportedWeeds.Source LIKE '%' + ? + '%') AND (ReportedWeeds.theDate
> >= ?) AND (ReportedWeeds.theDate <= ?)
> I pass in the following as parameters:
> Palmer
> 1/1/2006
> 12/31/2006
> But, when I execute this same query through the TableAdapter (that was
> created via the designer), it returns an error:
> The provider could not determine the Double value. For example, the row
> was just created, the default for the Double column was not available, and
> the consumer had not yet set a new Double value.
> When I was getting this error before, it was because the SITADDRS column
> as type Double. But, that error went away when I set the type as a string
> as it should have been.
> Can anyone help with this maybe?
> S
>

No comments:

Post a Comment