这是我的 sql 查询:
ALTER PROCEDURE GET_SAMEDATE ( @FileName nvarchar(max) ) AS
SELECT TOP 1 WITH TIES Hash
FROM Beamer.PackageDetailFile DF(NOLOCK)
INNER JOIN Beamer.PackageDetail D (NOLOCK) ON DF.PackageDetailId = D.Id
INNER JOIN Beamer.Package P (NOLOCK) ON D.PackageId = P.Id
WHERE FileName = @FileName AND P.EnvRelationId=3 AND P.IsPublished=1
ORDER BY Date DESC
我想要做的是,我也想从该表中选择日期,但是当我这样做时,我不能在另一个类中调用它们(单独阅读它们)。
try
{
myConnection.Open();
SqlDataReader sdr = myCommand.ExecuteReader();
while (sdr.Read())
{
string h = (string)sdr.GetString(0);
if (hash != h)
{
exists = true;
Class2 bala = new Class2();
bala.dbconnection3(FileName);
}
sdr.Read();
}
我的意思是我想单独阅读这些表格,但要在一个过程中获得它们。