I receive an error when trying to insert data into the Datatable.
Error: String or binary data truncated ---Here adapt.Fill(dt);
dt = new DataTable();
con = new SqlConnection(cs);
con.Open();
adapt = new SqlDataAdapter(@"CREATE TABLE #mytemptable (
Metric_Name varchar(100),
SOW_Baseline varchar(30),
CurrentStatus_Time varchar(300),
LoggedTime DateTime)
declare @Product varchar(300)
set @Product='" + DropDownList1.SelectedValue + @"'
declare @Customer varchar(300)
set @Customer='" + ((DropDownList)PlaceHolder1.FindControl("DDLCust")).SelectedValue + @"'
-- insert some data into it
insert into #mytemptable
-----select queries
-- view the data
select * from #mytemptable
-- drop the table if you want to
drop table #mytemptable ", con);
adapt.Fill(dt);