Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 31st, 2005, 03:00 AM
Registered User
 
Join Date: Jan 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Can help me to look into the code...

There is a system error in the code... but i not able to identify it... the store procedure is working fine... but don't know why still got error...


DataSet ds;
string dbConn ="Initial Catalog=Northwind;Data Source=THLEE;Integrated Security=SSPI;";
SqlParameter [] arParms = new SqlParameter[2];
arParms[0] = new SqlParameter("@MedicIc_No", SqlDbType.Int, 10,"Customer_Ic_No");
arParms[0].Direction = ParameterDirection.Input;
arParms[0].Value = txtMedicIC.Text;

arParms[1] = new SqlParameter("@Allergy", SqlDbType.Text, 40,"Customer_Allergy");
arParms[1].Direction = ParameterDirection.Output;

using (SqlConnection conn = new SqlConnection(dbConn) )
{
    conn.Open();
    using (SqlTransaction trans = conn.BeginTransaction())
    {

    ds = SqlHelper.ExecuteDataset(trans, commandType.StoredProcedure, "usp_SearchCustomerMedic", arParms);
    txtMedicAllergy.Text = arParms[2].Value.ToString();
    trans.Commit();
    }
    conn.Close();
    }






Similar Threads
Thread Thread Starter Forum Replies Last Post
Urgent:hard disk serial code and vb code ivanlaw Pro VB 6 0 July 25th, 2007 04:05 AM
VB: .Exe file, serial code and activation code ivanlaw Pro VB 6 8 July 6th, 2007 05:44 AM
code clinic - Why wont example asp code work? jardbf Classic ASP Basics 3 April 27th, 2006 06:22 PM
Writing Client Side Script from Code-Behind code sajid_pk Classic ASP Databases 1 January 18th, 2005 12:53 AM
disable forum code within [code] blocks? nikolai Forum and Wrox.com Feedback 0 October 23rd, 2003 07:52 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.