473,387 Members | 1,669 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Accesing SQL View form C# asp.net

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());
}
Jun 27 '08 #1
1 1708
On Apr 17, 12:46 pm, "Carlos" <pal...@gmail.comwrote:
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());
}
you could right click and view source.. you are not writing html .. so
it mite not get displayed..
Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: John | last post by:
Hi I have a main form which has a panel which contains a child form using the code; mainform.myPanel.Controls.Add(childform) So hierarchy is like this; MainForm->Panel->ChildForm. My question...
4
by: Pk | last post by:
Hi, Im having a problem in forms. I have a mdi parent form named Main, and a child form named form1. >From Main form, i have a certain menu item that when clicked, it opens form1. But the...
16
by: Mike | last post by:
Hi, I have a form with some controls, and a different class that needs to modify some control properties at run time. Hoy can I reference the from so I have access to its controls and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.