Accesing aSQL view from C#
- From: "Carlos" <palcar@xxxxxxxxx>
- Date: Thu, 17 Apr 2008 12:46:04 -0400
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
.
- Follow-Ups:
- Re: Accesing aSQL view from C#
- From: Bob Barrows [MVP]
- Re: Accesing aSQL view from C#
- Prev by Date: Re: database connectivity vb-sql
- Next by Date: Re: Accesing aSQL view from C#
- Previous by thread: Problem with ADOMD.NET and Pentaho (XMLA)
- Next by thread: Re: Accesing aSQL view from C#
- Index(es):
Relevant Pages
|
|