Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Software > ADO Data > Accesing aSQL v...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 4213 of 4320
Post > Topic >>

Accesing aSQL view from C#

by "Carlos" <palcar@[EMAIL PROTECTED] > Apr 17, 2008 at 12:46 PM

When I try to access a SQL Saved view calleed FilteredLead I do not get 
anythin back on asp.net if I run same SQL command on the SQL Editor I get 
all my results. Is it any way to use views in C# diffrent than tables ?

See my code



        MyString = "SELECT * from FilteredLead";
        //where fullname like '%ja%'
        SqlConnection myConnection = new 
SqlConnection("server=TEST;database=CRMTEST_MSCRM;UID=Joe;PWD=xxxx");

        SqlCommand myCommand = new SqlCommand(MyString, myConnection);
        SqlDataReader reader;

        string tempTotal = "";

        try
        {
            myConnection.Open();
            reader = myCommand.ExecuteReader();
            while (reader.Read())
            {
                Response.Write(reader[0].ToString());
            }
        }
        catch (SqlException ex)
        {
            Response.Write(ex.ToString());
        }





Thanks
 




 2 Posts in Topic:
Accesing aSQL view from C#
"Carlos" <pa  2008-04-17 12:46:04 
Re: Accesing aSQL view from C#
"Bob Barrows [MVP]&q  2008-04-17 14:50:15 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 14:46:53 CST 2008.