Showing posts with label dataset. Show all posts
Showing posts with label dataset. Show all posts

Thursday, March 22, 2012

Can't find how to add a line feed to a textbox

Hello,
I'm creating a report with a textbox that contains a field from the dataset
and some hard text (something like =First(Fields!MyField.Value) & "
TheTextPart"). This works, but when I try to do a shift+enter (line feed) I
get an error "The value expresxsion for the textbox 'textbox7' contains an
error: [BC30648] String constants must end with a double quote".
Is there any way to add a line feed / carriage return in a text box?
Thanks!
Ricktry this:
=First(Fields!MyField.Value) & vbcrlf & "The Second Line" & vbcrlf &
"The Third Line"|||Brilliant! Thanks Sleepy!
"SleepyLab" <david.blancard@.fairmont.com> wrote in message
news:1187036726.406106.312410@.d55g2000hsg.googlegroups.com...
> try this:
> =First(Fields!MyField.Value) & vbcrlf & "The Second Line" & vbcrlf &
> "The Third Line"
>

Thursday, February 16, 2012

Cant Connect to Sql Server

Warning extreme newbie.

I am trying to follow a .Net Walk Thru that connects to Sql Server. The SqlConnection, SqlDataAdapter, and DataSet all appear to be working properly, but when the web page opens I get a 'Sql Server Does Not Exist or Access Denied.'

Any ideas would be greatly apprieciated.

fryer

Is the connection string correct (i.e. username, password, server address, etc.) and do you have the correct permissions to access the database?

Ryan|||

Connection Strings: I have used the one generated with the SqlConnection Object and I have modified it many different ways. Integrated Security on & off, By Server name/IP Address. Using a port number & using TCIP/IP. I have also tried my connecting to my local computer and the office server.

Database: I definitely have rights to the database.

Could the problem be how it is connecting, some sort of port disconnect? Could something be overriding my connection string?

Thanks.

fryere

Sunday, February 12, 2012

Cant connect to database?

When I try to connect to ms server like this:

private DataSet hentVare()
{
string sql = "select * from vare";
string strForbindelse="server=localhost;trusted_connection=true;database=mericKebab;uid=ASLAN;password=;";

SqlConnection objConnect = new SqlConnection(strForbindelse);

SqlDataAdapter dataAdapter = new SqlDataAdapter(sql,objConnect);

DataSet dataSet = new DataSet();
dataAdapter.Fill(dataSet,"Vare");

return dataSet;
}

I get this error:

System.Data.SqlClient.SqlException: Cannot open database requested in login 'mericKebab'. Login fails. Login failed for user 'ASLAN\ASPNET'.

can someone plz help me with this?Since you are using trusted SQL Server connection and the IIS virtual directory is running under the ASPNET account the application is trying to connect using that account. Try changing the IIS virtual folder to a valid domain user account that has rights on the SQL Server database you are connecting or change the authentication to SQL Server authentication and give a valid User name and password.

For more on connection strings... Visit www.ConnectionStrings.com