使用VB.NET文本框和存储过程搜索SQL数据 [英] Search SQL Data using VB.NET Textbox with Stored Procedure

查看:99
本文介绍了使用VB.NET文本框和存储过程搜索SQL数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的专家,

我在编码时使用存储过程和vb.net表单从数据库中搜索数据时遇到问题.我使用vb语言而不是C#进行编码.

说明:

我已存储名为"usp_GetPayByGrade"的过程:

Dear Expertise,

I am problem with coding to search the data from database using stored procedure and vb.net form. I am coding with vb language not the C#.

Explanation:

I have stored procedure named "usp_GetPayByGrade" :

[code]
/*
Name: usp_GetPayByGrade
Description: Search the Record to dbo.hrGradePayScale table by gpsIntGrade
Author: Tashi
Modification: Update

Description				Date			Changed By
Created Procedure		27/10/2011		Tashi
*/
CREATE proc [dbo].[usp_GetPayByGrade]
(
	@gpsIntGrade varchar(50)
)
WITH ENCRYPTION
AS
SELECT 
	gpsGrade,
	gpsIntGrade,
	gpsMinPay,
	gpsIncrement,
	gpsMaxPay,
	gpsGISGroup,
	gpsGISCont,
	gpsSWSCont,
	gpsSWSPercentageYN,
	gpsRetirementAge
	FROM [dbo].[hrGradePayScale]
WHERE gpsIntGrade =@gpsIntGrade
[/code]



当我在SQL中运行此存储过程时,它会给我正确的结果.

我有一个名为"frmGetPayByGrade"的表单,其内容为:

1.文本框:
gpsGrade
gpsIntGrade =在此文本框中,用户将输入值
gpsMinPay
gpsIncrement
gpsMaxPay
gpsGISGroup
gpsGISCont
gpsSWSCont
2.按钮:
btnSearch
btnClose

当用户在"gpsIntGrade"文本框中输入值并单击"btnsearch"时,应运行存储过程并将存储过程结果填充到相应的文本框中.

我一直在尝试搜索,但无法找到正确的解决方案.

任何人都可以帮助我吗???????



when i run this store procedure in SQL its giving me correct result.

I have a form named "frmGetPayByGrade" with:

1. Textboxes:
gpsGrade
gpsIntGrade = in this textbox user will enter the value
gpsMinPay
gpsIncrement
gpsMaxPay
gpsGISGroup
gpsGISCont
gpsSWSCont
2. buttons:
btnSearch
btnClose

When user enters the value at "gpsIntGrade" textbox and hits the "btnsearch" it should run the stored procedure and fill the stored procedure result in respective textbox.

I have been trying to search but could not get the proper solution.

CAN ANYONE HELP ME???????

推荐答案

请参考以下链接

http://stackoverflow.com/questions/9152247/在多个文本表中显示来自存储过程的数据 [
Please refer the below link

http://stackoverflow.com/questions/9152247/displaying-data-from-stored-procedures-with-multiple-tables-into-textbox[^]


这篇关于使用VB.NET文本框和存储过程搜索SQL数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆