[英]In Blazor Web Assembly ASP.net core hosted
Thhis is my method in the server, I want to pass the filled Data.table DtDictionary to the client, how?这是我在服务端的方法,我想把填好的Data.table DtDictionary传给客户端,怎么办?
public class ClssDictionary
{
public static DataTable DtDictionary = new();
public static async Task M2dDictionary()
{ try
{
SqlConnection sqlconNew = new(StrSqlconnection);
await sqlconNew.OpenAsync();
string strSqlcmdQry = "select * from dictionary";
SqlCommand sqlcmdQry = new(strSqlcmdQry, sqlconNew);
SqlDataAdapter sqldaNew = new(sqlcmdQry);
sqldaNew.Fill(DtDictionary);
}
catch (SystemException se) { Console.WriteLine( se.Message); }
}
}
Well your question is not clear, But i can imagine you have server application that filled this DataTable and you want a client application to be able to get this DataTable.嗯,你的问题不清楚,但我可以想象你有填充这个数据表的服务器应用程序,你希望客户端应用程序能够获取这个数据表。 Well since they are both different Apps you can pass the data between them using JSON, your server should provide an end-point that can be called from the client.
好吧,因为它们都是不同的应用程序,您可以使用 JSON 在它们之间传递数据,您的服务器应该提供一个可以从客户端调用的端点。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.