1
Answer

with our asp.net mvc framework.we have to manully create model,view,controller

KRayudu V

KRayudu V

12y
999
1
Hi Sir/Madam
         Can any one send the samples for asp.net mvc(with using asp.net mvc frame work we have to do by taking some blanksolution in vs2010 or 2008).how to do CRUD operations in asp.net mvc with out the help of asp.net mvc framework.
I have some idea how to do,but i dont know how to implement the code.so,any one please help me on this
Answers (1)
0
Sarah
NA 8 3.9k 13y
No error but the data doesn't display in the listbox. :( sorry for the trouble. i'm not good in codings.
0
Prabhu Raja
NA 4.7k 1.5m 13y
Hope this will work.

foreach(char str in e.result)
{
   listBox1.Items.Add(str.ToString());
}



0
Sarah
NA 8 3.9k 13y
Hi Pravin,
             the codes doesnt work well.
 
error for foreach: Cannot convert type 'char' to 'string'.


error for ListBox.Add(str); : Error 1 'System.Windows.Controls.ListBox' does not contain a definition for 'Add' and no extension method 'Add' accepting a first argument of type 'System.Windows.Controls.ListBox' could be found (are you missing a using directive or an assembly reference?)

0
Pravin More
NA 2.6k 136.1k 13y
hi sarah ,
                ok then you can add it by foreach.......

try like this...

foreach(string str in e.result)
{
   listBox1.Add(str);
}

note:- i hope you can do any typecast or to list if required.

let me know if works or not.

Thanks,
Pravin.
0
Sarah
NA 8 3.9k 13y
Hi Pravin, i have alrdy done that in my web service. The problem is i'm using web client method so i think i'm supposed to use the XDocument to help retrieve the data to the listbox successfully. i cant seems to retrieve the data from database :(

this is how my codings in xaml.cs look like:

public Details
{
InitializeComponent();
WebClient proxy = new WebClient();
            string baseUri = "http://localhost:1723/ServiceImpl.svc/GetDetails";
            proxy.DownloadStringCompleted += new DownloadStringCompletedEventHandler(proxy_DownloadStringCompleted);
            proxy.DownloadStringAsync(new Uri(baseUri));
}

void proxy_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
       {
           if (e.Error != null)
           { return; }
           if (e.Result == null)
            MessageBox.Show("NUlllllllllll");

           XDocument xmlCurrent = XDocument.Parse(e.Result);


           ListBox.DataContext = xmlCurrent;

       }
0
Pravin More
NA 2.6k 136.1k 13y
Hi Sarah,

               you can return List<string> from your web service and bind it to listbox.

                 i.e. return type of service will be List<string>