Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have not declared or created any table which contains "MailId". I connect database by using entity model method.



XML
<script>
       $(document).ready(function () {
           $.ajax(
               {
                   type: 'GET',
                   dataType: 'json',
                   contentType: 'application/json;charset=utf-8',
                   url: 'http://localhost:53499/api/Values',
                   success: function (data) {
                       //alert(URL)
                       try {
                           debugger;
                           var html = '<table> <thead> <th>Mail ID</th> <th>Subscription ID</th> <th> Subscription Date </th> </thead><tbody>';
                           $.each(data, function (key, val) {
                               debugger;
                               html += '<tr><td>' + '<a ' + 'href="mailto:' + val.MailID + '">' + val.MailID + '</a>' + '</td><td>' + val.SubscriberID +'</td><td>' + val.SubscribedDate + '</td></tr>';
                           });
                           html += '</tbody></table>';
                           $('#myGrid').html(html);
                       } catch (e) {
                           console.log('Error while formatting the data : ' + e.message)
                       }
                   },
                   error: function (xhrequest, error, thrownError) {
                       console.log('Error while ajax call: ' + error)
                   }
               }
               );
       });
      </script>



The Code copied from this link Load Data From Database Using Web API[^]

Please find this link.
Posted
Comments
Krunal Rohit 18-Nov-15 8:36am    
tbl_Subcscriber has the field MailID.

-KR
Sathish km 18-Nov-15 9:26am    
But i'm not using that table.
Sathish km 18-Nov-15 9:35am    
html += '<tr><td>' + '' + val.MailID + '' + '</td><td>' + val.SubscriberID +'</td><td>' + val.SubscribedDate + '</td></tr>';

i'm not using any of these fields. I just copy & Paste the code, While typing val., the intellisense showing SubscriberID,SubscribedDate,MailID..
How it is?
Sathish km 18-Nov-15 9:35am    
tml += '<tr><td>' + '' + val.MailID + '' + '</td><td>' + val.SubscriberID +'</td><td>' + val.SubscribedDate + '</td></tr>';

I'm not used any of these fields, i just copy& paste it. while i typing val. means the intellisense is showing SubscribedDate ,MailID .. How it is?
George Jonsson 18-Nov-15 21:23pm    
Intellisense uses the references you have provided in the code and sometimes these references are cached.
So what is the problem? That intellisense shows you some options you don't need?
Just ignore it. It doesn't interfere with the execution of your code.

1 solution

I think you should write a new question where you describe what it is you want to do instead of dumping a piece of code you found somewhere.

But before you do that, write a small specification where you break down your application in smaller pieces.
Then you do some research about how to solve the smaller pieces.
Then you connect the dots.

Example Spec

Overall goal
I want my web page to have a button/link where a user can click and subscribe to my fantastic newsletter.
To get the correct mail address from my SQL database.

Possible Languages or Frameworks
JavaScript, JQuery, AngularJS or whatever.

Road blocks
How to send a mail in JavaScript?
How to read data from an SQL database?
How to bind the data?

If you then run into a problem with a specific matter you can post it here with a nice and clear description, together with the code you are stuck with.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900