Error in Ajax Slideshow Extender

Posted by Saritha.rajeshkumar under C# on 7/27/2011 | Points: 10 | Views : 1385 | Status : [Member] | Replies : 1
Hi ,

iam working with Ajax Slideshow Extender iam getting the Error "CS0019: Operator '+' cannot be applied to operands of type 'string[]' and 'string[]'
"
My Code is

if (!IsPostBack)
{
SqlCommand cmd = new SqlCommand("select imagepath1,MainImage from model_master where model_id=" + Session["modelid"].ToString(), con);
ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(ds);

k = ds.Tables[0].Rows[0][1].ToString();
string[] imgs = k.Split();
Image[] img = new Image[imgs.Length];
int a = 0;
img[a] = new Image();
img[a].ImageUrl = "../Uploads/Modelling/" + imgs[a];
img[a].Width = 160;
img[a].Height = 108;
imgspanel.Controls.Add(img[a]);

i = ds.Tables[0].Rows[0][0].ToString();
string[] imgssss = i.Split('~');
Image[] images = new Image[imgssss.Length];
for (int ab = 0; ab < imgssss.Length; ab++)
{
images[ab] = new Image();
images[ab].ImageUrl = "../Uploads/Modelling/" + imgssss[ab];
images[ab].Width = 160;
images[ab].Height = 108;
imgspanel.Controls.Add(images[ab]);
}

[System.Web.Services.WebMethodAttribute(), System.Web.Script.Services.ScriptMethodAttribute()]
public static AjaxControlToolkit.Slide[] GetSlides(string contextKey)
{
int j = 0;
string[] imgs = (i.Split('~') + k.Split());
AjaxControlToolkit.Slide[] slides = new AjaxControlToolkit.Slide[imgs.Length];
foreach (string img in imgs)
{
slides[j] = new AjaxControlToolkit.Slide();
//slides[j].Description = "bb";
//slides[j].Name = "aa";
slides[j].ImagePath = "../Uploads/Modelling/" + img;
j++;
}

return slides;
}




Responses

Posted by: Vforvijay on: 7/27/2011 [Member] Starter | Points: 25

Up
0
Down
hi..try this below link
http://vbdotnetaddict.blogspot.com/2011/07/how-to-slideshow-images-from-database.html

Saritha.rajeshkumar, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response