38、数据访问与XML在Web应用中的使用

数据访问与XML在Web应用中的使用

1. 数据访问与应用设计

在Web应用开发中,数据的插入、更新和删除是常见操作。以一个允许用户编辑、删除和插入学生信息的Web表单 ch14 - 9.aspx 为例,除了插入新学生记录的例程,其他代码与 ch14 - 8.aspx 类似。插入学生记录的代码如下:

Sub insertName(ByVal last As String, ByVal first As String, _
ByVal Grade As String)
    Dim conn As New SqlConnection(System.Configuration. _
    ConfigurationSettings.AppSettings.Get("ClassRecordsSql"))
    Dim cm As New SqlCommand("INSERT INTO Students (LastName, " & _
    "FirstName,Grade) VALUES ('" & last & "','" & first & "', " _
    & Grade & ")", conn)
    Try
        conn.Open()
        cm.ExecuteNonQuery()
        Me.showAddNameGroup(False)
    Catch ex As Exception
        Me.lblStudentNameError.Text = ex.Mes

相关推荐

wps连接mysql数据库_SpringBoot框架与MyBatis集成,连接Mysql数据库

SpringBoot是一种用来简化新Spring应用初始搭建及开发过程的框架,它使用特定方式来进行配置,使得开发人员不再需要定义样板化的配置。MyBatis是一个支持普通SQL查询、存储和高级映射的持久层框架,它消除了几乎所有的JDBC代码和参数的手工配置以及对结果集的检索封装,可以使用简单的XML或注解用于配置和原始映射,将接口和Java的对象映射成数据库中的记录。最近的项目有相关需求,集成Sp...

weixin_30488835的博客 818

STM32 野火MINI 用FontCvtST.exe 生成.c文件 写汉字到文本框 按钮上

STM32 野火MINI 用FontCvtST.exe 生成.c文件 写汉字到文本框 按钮上 参考了好多大神博客,自己写的过程中发现,还有些小细节。 一、打开Notepad写需要的字 另存为 UTF-16LE 也就是Unicode。 二、打开FontCvtST转 删掉所有字 读入test.txt里的字 选择刚才的test.txt 另存为.c文件 改个英文名 复制到RTOS的例程文件夹下 三、打开GUIBuilder 画一个这样的 保存之前要注意路径配置要在当前位置,否则存不上 生成的D

weixin_41376117的博客 1935

Camera Sensor接口协议全解析(六)聚焦onsemi HiSPi接口的技术突破与应用实践

摘要: Onsemi HiSPi是一种高速并行接口协议,专为高分辨率图像传感器设计,具备1600 Mbps传输速率、低功耗和高兼容性特点。通过对比DVP、MIPI CSI-2等主流协议,HiSPi在工业/医疗领域表现突出,支持动态功耗控制、多ROI和CRC校验。其创新架构包含多PHY设计,提供分组SP、流SP等多种工作模式,满足灵活传输需求。实际应用中,HiSPi在PCB缺陷检测(5μm精度)和液晶面板检测(0.3% Mura检出率)等场景展现卓越性能,成为高速成像领域的关键技术。

GateWorld的博客 1435

R语言 Chow Test

Chow 测试用于测试不同数据集上的两个不同回归模型中的系数是否相等。 该测试通常用于计量经济学领域,使用时间序列数据来确定数据在某个时间点是否存在结构性中断。 本教程提供了如何在 R 中执行 Chow 测试的分步示例 首先,我们将创建一些假数据: #create data data <- data.frame(x = c(1, 1, 2, 3, 4, 4, 5, 5, 6, 7, 7, 8, 8, 9, 10, 10, 11, 12, 12, 13,

Mrrunsen的博客 1946

【STK】手把手教你利用STK进行光电红外仿真04-STK/EOIR模块的实战操作1航天器星载相机对LEO卫星成像

今天引入一个实际的场景,帮助大家完成对于这个模块的理解与运用。

weixin_44184852的博客 2417

【基础-多选】HarmonyOS鸿蒙应用开发

1、HarmonyOS提供了基础的应用加固安全能力,包括混淆、加密和代码签名能力。正确2、可以通过ohpm uninstall 指令下载指定的三方库。错误3、支持模块化开发是指一个应用通常会包含多种功能,将不同的功能特性按模块来划分和管理是一种良好的设计方式。在开发过程中,我们可以将每个功能模块作为一个独立的Module进行开发,Module中可以包含源代码、资源文件、第三方库、配置文件等,每一个Module可以独立编译,实现特定的功能。这种模块化、松耦合的应用管理方式有助于应用的开发、维护与扩展。正确。

江拥羡橙的博客 1万+

【2022】人工智能☆✨

1. 朴素⻉叶斯⽅法是⼀种 ( ) ⽅法。A.机器学习的分类B.不确定性推理C.知识表示答案:A解析:朴素贝叶斯分类器是基于贝叶斯定理与特征条件独立假设的分类方法。它通过学习训练数据集来预测未知数据的类别标签,因此属于机器学习中的监督学习分类方法。选项B不确定性推理和选项C知识表示虽然与朴素贝叶斯方法有一定的关联,但它们并不是朴素贝叶斯方法的主要应用领域或定义特性。2. 关于启发式搜索描述正确的是 ( )。

super_mochi1 391

SpringBoot系列之实现一个AI聊天助手

本文介绍了基于Spring Boot框架实现的AI聊天助手项目。该项目使用Spring Boot 3.2.3、Spring AI 1.0.0-M5等技术栈,集成DeepSeek-R1-Distill-Llama-8B模型实现智能对话功能。文章详细介绍了项目配置流程、运行方式和核心代码实现,包括ChatMessage模型类和服务类ChatService的关键功能,如消息处理、历史记录管理和AI响应获取等。读者可通过提供的GitHub链接获取完整代码,快速搭建自己的AI聊天应用。

Nicky's blog 1450

Unity GameObject 核心机制深度解析:从底层结构到工程实践

从底层机制讲透 Unity GameObject:托管壳加原生芯的双层对象模型如何制造假 null 陷阱、Transform 层级与组件通信的原理、生命周期回调的确切顺序。文章同时给出 Instantiate 成本分析与对象池等高频场景的工程实践。

游戏人生 40

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

NTscan扫描工具

ntscan是一个扫描器,可以扫描没有密码和弱密码的共享,先到配置文件中填写猜测的用户名和密码,扫描过程中右侧出现的是扫描日志。

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

上一篇: 4、深入理解Horizon 7架构与组件
下一篇: 21、深入探索Hibernate:特性、集成与应用
dapp9builder
博客等级 码龄1天 0粉丝 1648原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值