G
Guest
I got the following error:
Error 1 error C2597: illegal reference to non-static member
'Microsoft::SqlServer::Server::SqlFunctionAttribute::FillRowMethodName'
when compiling
#include "stdafx.h"
using namespace System;
using namespace System:ata;
using namespace System:ata::Sql;
using namespace System:ata::SqlTypes;
using namespace Microsoft::SqlServer::Server;
using namespace System::Collections;
// select dbo.MyUDF()
// go
public ref class AddNewUDF
{
public:
[SqlFunction(SqlFunctionAttribute::FillRowMethodName = "FillRow")]
static IEnumerable^ MyUDF()
{
SqlTypes::SqlString Value(L"Hello");
DataTable dt;
dt.Rows->Add("");
return dt.Rows;
}
static void FillRow(Object obj, SqlChars^ message, SqlChars^ category,
long^ instanceId)
{
message = gcnew SqlChars("Test");
category = gcnew SqlChars("Test");
instanceId = 123;
}
};
Btw, what's the least cost way to return a one line IEnumerable object?
Error 1 error C2597: illegal reference to non-static member
'Microsoft::SqlServer::Server::SqlFunctionAttribute::FillRowMethodName'
when compiling
#include "stdafx.h"
using namespace System;
using namespace System:ata;
using namespace System:ata::Sql;
using namespace System:ata::SqlTypes;
using namespace Microsoft::SqlServer::Server;
using namespace System::Collections;
// select dbo.MyUDF()
// go
public ref class AddNewUDF
{
public:
[SqlFunction(SqlFunctionAttribute::FillRowMethodName = "FillRow")]
static IEnumerable^ MyUDF()
{
SqlTypes::SqlString Value(L"Hello");
DataTable dt;
dt.Rows->Add("");
return dt.Rows;
}
static void FillRow(Object obj, SqlChars^ message, SqlChars^ category,
long^ instanceId)
{
message = gcnew SqlChars("Test");
category = gcnew SqlChars("Test");
instanceId = 123;
}
};
Btw, what's the least cost way to return a one line IEnumerable object?