Click here to Skip to main content
15,905,682 members
Home / Discussions / Database
   

Database

 
GeneralRe: executing procedure via ODBC Connection Pin
apoorva_raje29-May-07 2:00
apoorva_raje29-May-07 2:00 
QuestionHow to call an oracle stored procedure from sql server Pin
saurabh7628-May-07 0:52
saurabh7628-May-07 0:52 
AnswerRe: How to call an oracle stored procedure from sql server Pin
Mike Dimmick29-May-07 11:38
Mike Dimmick29-May-07 11:38 
Questionproblem gettin specific record.. Pin
rcwoods27-May-07 22:50
rcwoods27-May-07 22:50 
AnswerRe: problem gettin specific record.. Pin
Colin Angus Mackay28-May-07 0:09
Colin Angus Mackay28-May-07 0:09 
GeneralRe: problem gettin specific record.. Pin
rcwoods28-May-07 1:13
rcwoods28-May-07 1:13 
GeneralRe: problem gettin specific record.. Pin
Colin Angus Mackay28-May-07 1:19
Colin Angus Mackay28-May-07 1:19 
GeneralRe: problem gettin specific record.. Pin
rcwoods28-May-07 1:33
rcwoods28-May-07 1:33 
here is more of my code
maybe you can see whats wrong.
this is from my web form:

ShipperDetails[] shipperArray = dac.GetAllShippers();

foreach (ShipperDetails shipper in shipperArray)
{
ListItem item = new ListItem();
item.Text = shipper.CompanyName;
item.Value = shipper.ID.ToString();

DropDownList1.Items.Add(item);
}

public ShipperDetails[] GetAllShippers()<br />
        {<br />
            SqlConnection con = new SqlConnection(connString);<br />
            SqlCommand cmd = new SqlCommand("GetAllShippers", con);<br />
            cmd.CommandType = CommandType.StoredProcedure;<br />
<br />
            //collection for all shipper records<br />
            ArrayList shippers = new ArrayList();<br />
            try<br />
            {<br />
                con.Open();<br />
                SqlDataReader reader = cmd.ExecuteReader();<br />
<br />
                while (reader.Read())<br />
                {<br />
<br />
                    ShipperDetails shipper = new ShipperDetails((int)reader["ShipperID"], (string)reader["CompanyName"], (string)reader["Phone"]);<br />
<br />
                    shippers.Add(shipper);<br />
<br />
                }<br />
                reader.Close();<br />
<br />
                return (ShipperDetails[])shippers.ToArray(typeof(ShipperDetails)); <br />
            }<br />


this is called when i select a particular shipper from the dropDownList:

public ShipperDetails GetShipper(int shipperID)<br />
        {<br />
            SqlConnection con = new SqlConnection(connString);<br />
            SqlCommand cmd = new SqlCommand("GetShipper", con);<br />
            cmd.CommandType = CommandType.StoredProcedure;<br />
<br />
            cmd.Parameters.Add(new SqlParameter("@ShipperID", SqlDbType.Int, 4));<br />
            cmd.Parameters["@ShipperID"].Value = shipperID;<br />
<br />
            try<br />
            {<br />
                con.Open();<br />
                SqlDataReader reader = cmd.ExecuteReader(CommandBehavior.SingleRow);<br />
<br />
                //get 1st row<br />
                reader.Read();<br />
                int shipperId = (int)reader["ShipperID"];<br />
                string companyName = (string)reader["CompanyName"];<br />
                string phone = (string)reader["Phone"];<br />
                    <br />
                ShipperDetails shipper = new ShipperDetails(shipperId,companyName,phone);<br />
                <br />
                reader.Close();<br />
<br />
                return shipper;<br />
            }

GeneralRe: problem gettin specific record.. Pin
Colin Angus Mackay28-May-07 1:48
Colin Angus Mackay28-May-07 1:48 
GeneralRe: problem gettin specific record.. Pin
rcwoods28-May-07 2:04
rcwoods28-May-07 2:04 
GeneralRe: problem gettin specific record.. Pin
Colin Angus Mackay28-May-07 2:17
Colin Angus Mackay28-May-07 2:17 
GeneralRe: problem gettin specific record.. Pin
rcwoods28-May-07 3:55
rcwoods28-May-07 3:55 
GeneralRe: problem gettin specific record.. Pin
sam#28-May-07 2:03
sam#28-May-07 2:03 
GeneralRe: problem gettin specific record.. Pin
rcwoods28-May-07 3:48
rcwoods28-May-07 3:48 
GeneralRe: problem gettin specific record.. Pin
rcwoods28-May-07 3:52
rcwoods28-May-07 3:52 
QuestionStored procedure probs..., [modified] Pin
Member 387988127-May-07 19:11
Member 387988127-May-07 19:11 
AnswerRe: Stored procedure probs..., Pin
Harini N K27-May-07 19:21
Harini N K27-May-07 19:21 
GeneralRe: Stored procedure probs..., Pin
Member 387988127-May-07 19:27
Member 387988127-May-07 19:27 
AnswerRe: Stored procedure probs..., Pin
Harini N K27-May-07 19:37
Harini N K27-May-07 19:37 
GeneralRe: Stored procedure probs..., Pin
Member 387988127-May-07 20:20
Member 387988127-May-07 20:20 
GeneralRe: Stored procedure probs..., Pin
Harini N K27-May-07 20:26
Harini N K27-May-07 20:26 
GeneralRe: Stored procedure probs..., Pin
Harini N K27-May-07 20:27
Harini N K27-May-07 20:27 
GeneralRe: Stored procedure probs..., Pin
Member 387988127-May-07 20:41
Member 387988127-May-07 20:41 
GeneralRe: Stored procedure probs..., Pin
Harini N K27-May-07 20:45
Harini N K27-May-07 20:45 
Questionxp_smtp_sendmail Pin
Rahul Babu27-May-07 18:43
Rahul Babu27-May-07 18:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.