We are creating the site in Visual Studio 2010 using C# and ASP.Net webforms. We have no idea why its broke and gone wrong followed an online tutorial and after fixing other problems the code had this error has come up and i dont know how to fix it or what i have done wrong if anyone can see a the problem please let me know.
using System;
using System.Collections;
using System.Configuration;
using System.Data.SqlClient;
public class ConnectionClass
{
private SqlConnection conn;
private SqlCommand command;
ConnectionClass()
{
string connectionString = ConfigurationManager.ConnectionStrings["Connection"].ToString();
conn = new SqlConnection(connectionString);
command = new SqlCommand("", conn);
}
private ArrayList GetClothesByType(string ClothesType)
{
ArrayList list = new ArrayList();
string query = string.Format("SELECT * FROM fusey WHERE type LIKE '{0}'", ClothesType);
try
{
conn.Open();
command.CommandText = query;
SqlDataReader reader = command.ExecuteReader();
while (reader.Read())
{
int id = reader.GetInt32(0);
string name = reader.GetString(1);
string type = reader.GetString(2);
double price = reader.GetDouble(3);
string size = reader.GetString(4);
string image = reader.GetString(5);
string review = reader.GetString(6);
Fusey fusey = new Fusey(id, name, type, price, size, image, review);
list.Add(fusey);
}
}
finally
{
conn.Close();
}
return list;
}
internal static ArrayList GetClothesByType(object ClothesType)
{
throw new NotImplementedException();
}
}