473,749 Members | 2,356 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to call stored procedure in vb?

5 New Member
this is my stored procedure... how can i get the value of a datetimepicker1 in vb.net form and stored it in @date1 and @date2
Expand|Select|Wrap|Line Numbers
  1.  
  2. CREATE PROCEDURE SAT
  3.  
  4.     @date1 datetime,
  5.     @date2 datetime
  6. AS
  7.  
  8.     SELECT DISTINCT cnsgne, broker,
  9.         COUNT(case when cntsze=20 then cntsze end) as '20',
  10.         COUNT(case when cntsze=40 then cntsze end) as '40',
  11.         COUNT(case when cntsze=45 then cntsze end) as '45'
  12.     FROM CYMgps
  13.     WHERE (sysdte BETWEEN @date1 and @date2)
  14.     GROUP BY cnsgne, broker
  15.     ORDER BY cnsgne asc
  16.     RETURN
  17.  
  18.  
  19.  
Jan 16 '13 #1
0 918

Sign in to post your reply or Sign up for a free account.

Similar topics

7
2275
by: Luis | last post by:
I'm using code similar to the following in an asp page to call a stored procedure that does a select on a SQLServer 2000 table: dim rs, SelectSql SelectSql = "EXEC spSelectStuff @param = '" & ParamValue & "'" set rs = conn.Execute(SelectSql) -- do some stuff with rs -- rs.close : set rs = nothing...
2
9726
by: syoung | last post by:
I would like to know if anyone knows how to execute a stored procedure from ASP.NET 2.0. I'm using the NorthWind database and I'm trying to execute the "CustOrderHist" stored procedure. The error I get is "Incorrect syntax near 'CustOrderHist'. " Public Function GetCustomerOrderHistory(ByVal customerid As String) As SqlDataReader Dim conn As New SqlConnection(conString) Dim cmd As New SqlCommand("CustOrderHist", conn)
1
1835
by: Jenny C. | last post by:
Hi I am fairly new to .NET, and I am having a hard time to call a stored procedure from C# code in a windows application I have tested my connection (and login) several time and it is OK. If I try to do a query it works, but when I try to call a stored procedure i get the message "System Error". My code is shown below Any idea what could be the problem A million thanks Jenn ------------------------
6
2319
by: Sam | last post by:
I had created stored procedure at SQL Server 2000 and how do I call it via ASP.Net using VB Language? CREATE PROCEDURE STK As if exists (select * from dbo.sysobjects where id = object_id(N'.') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table . GO
3
7225
by: sarma | last post by:
Hi friends, I created a stored procedure in MySQL like create procedure p() select NOW(); I write a C program, from which i wish to call this stored procedure, i used both mysql_query() and mysql_real_query() functions, but unable to call this stored procedure. Can U please help me out in this...... "CALL p() failed: PROCEDURE sarma.p can't return a result set in the given context" is the error Im getting.
3
3303
by: JM | last post by:
Hi, I am using SQL Server 2000 and ASP.NET 2.0 and want to call a stored procedure using Latest Enterprise Library 2.0. My stored procedure has 3 input parameters: CustId (int), RefId(int) and EmailId(varchar 200) and it returns a dataset. This is how I am trying to do: ------------- int CustId = 1
1
3819
by: eholz1 | last post by:
Hello PHP Group, Is there any advantages (or disadvantages) in using mysqli instead of mysql (querys, connections to database, etc). I am currently using mysql_connect, and things like this: $result = @mysql_query("SELECT * FROM images3 WHERE id=" . $img . " AND p=" .$p. ""); to access my database. I see that some people are using the
0
3810
by: pbaillard | last post by:
Here a sample to call a stored procedure with an Oracle Database. odc.Connection = m_cDb ' use an open connection to your database odc.CommandType = CommandType.StoredProcedure odc.CommandText = "pkg_func.GetReqStatus" ' just set the name of the function, don't used syntax like {? = call pkg_func.GetReqStatus(?,?,?)} ' the return parameter odp = New OleDbParameter("result", OleDbType.VarChar)
2
3014
by: E11esar | last post by:
Hello there. I am going in bit of a circle with this matter; First some background: I am trying to upload the details of a CSV file into an Oracle table. I am using a StreamReader to copy a line at a time into an array, using a string columns = line.Split(separators.ToCharArray()); command. Here is a definition of the table I am loading into:
3
7697
akashazad
by: akashazad | last post by:
Hi Friends My question is "can we call Stored Procedure from a User Defined Function in SQL" If yes then pl tell me how? If No then pl tell me why not ? While I was trying finding about the this question on internet I m getting both kind of answers hence I am confused . Pl help,Thanx in advance
0
8832
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9388
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9333
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8256
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6800
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6078
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4608
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3319
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2217
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.