Note that there are some explanatory texts on larger screens.

plurals
  1. PONo overload for method 'GetKennel' takes 1 arguments c#
    primarykey
    data
    text
    <p>Just getting to grips with fundimentals of c# so I apologise in advance if this is an easy fix/not explained properly</p> <p>Story aim: Make a UI that connects info from sql</p> <p>Problem: Error as title states, tried everything to my knowledge to try and fix it, get around it, etc.</p> <p>What I want to do is show the results of the kennel in the UI panel when the user selects 'view kennel'</p> <p>in theory it should look like this:</p> <p>Kennel name [txtbox "example"]<br> Address1 [txtbox "Example"]<br> etc etc...</p> <pre><code> private void **Kennel_Load(object sender, EventArgs e)** &lt;-------Error { DataTable dt = _kennelDAL.GetKennel(_kennelDAL); if (dt.Rows.Count &gt; 0) { DataRow row = dt.Rows[0]; txtKennelName.Text = row["Name"].ToString(); txtAddress1.Text = row["Address1"].ToString(); txtAddress2.Text = row["Address2"].ToString(); txtAddress3.Text = row["Address3"].ToString(); txtPostcode.Text = row["Postcode"].ToString(); txtCapacity.Text = row["Capacity"].ToString(); } } </code></pre> <p>This codes definition comes from...</p> <pre><code> public DataTable GetKennel(string name, string address1, string address2, string address3,string postcode, int capacity) { DataTable dt = new DataTable(); //Code here using (SqlConnection con = new SqlConnection(ConnectionString)) { SqlCommand cmd = new SqlCommand("[dbo].[Kennel_SelectByID]", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Kennel_Name", name); cmd.Parameters.AddWithValue("@Kennel_Address1", address1); cmd.Parameters.AddWithValue("@Kennel_Address2", address2); cmd.Parameters.AddWithValue("@Kennel_Address3", address3); cmd.Parameters.AddWithValue("@Kennel_postcode", postcode); cmd.Parameters.AddWithValue("@Kennel_capacity", capacity); SqlDataAdapter sda = new SqlDataAdapter(cmd); sda.Fill(dt); } return dt; </code></pre> <p>Again apologies if there is problems with this question, just been stuck on this for a good while! Cheers</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload