简体   繁体   English

In Blazor Web Assembly ASP.net core hosted

[英]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.

相关问题 Blazor Web 组装与 asp.net 核心托管与 Z98AD8B3C99B3CA16F4F7FA84EE64C 项目 - Blazor Web Assembly with asp.net core hosted vs Blazor Server Project 了解 Blazor 装配与 ASP.net 核心托管 Model - Understanding Blazor Assembly with ASP.net Core Hosted Model 在 Blazor Web 程序集 ASP.NET 核心托管中读取 wwwroot 内的文件 - Reading a file inside wwwroot in Blazor Web Assembly ASP.NET Core hosted Blazor WASM Asp.net 核心是否托管 = Blazor 服务器端? - Is Blazor WASM Asp.net core Hosted = Blazor server side? 如果我检查了 ASP Net Core Hosted Option,有没有办法部署 Blazor Web 程序集? - Is there a way to deploy Blazor Web Assembly if I checked the ASP Net Core Hosted Option? Blazor Web Assembly App .Net Core Hosted:发布运行时错误 - Blazor Web Assembly App .Net Core Hosted: publish runtime error Blazor - WebAssemby ASP.NET Core 托管模型 - Blazor - WebAssemby ASP.NET Core hosted model 部署托管到 Azure 的 Blazor WebAssembly 应用 ASP.NET Core - Deploy Blazor WebAssembly App ASP.NET Core hosted to Azure 在红隼中托管 blazor wasm asp.net 核心托管应用 - Hosting blazor wasm asp.net core hosted app in kestrel ASP.NET Core 托管 Blazor 模板中的授权问题 - Authorization issue in ASP.NET Core hosted Blazor template
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM