Showing posts with label figure. Show all posts
Showing posts with label figure. Show all posts

Sunday, March 25, 2012

Bind a label to an SqlDataSource

Hi all,

I would like to do something I thought was simple but I can't seem to figure it out. I would like to bind the Text properties to two labels to the columns in an SqlDataSource, much the same as you can bind a listbox to a SqlDataSource.

Is this possible?

The reason why I'm trying it this way is because I originally used an OleDB connection and datareader, but it doesn't seem to work on our service providers server (keeps saying that it can't find the database) even though it works on the four other server's I've tried. It definitely connects to the database when I use the SqlDataSource on a listbox control, but it fails when I use the same connection string with the OleDB connection.

Is this the best way to go about it, or should I persist with finding the OleDB/datareader (the service provider has been no help at all).

Thanks.

If you want to use SqlDataSource, why not bind SqlDataSource with GridView? So that you can view all records:

<asp:SqlDataSource ID="mySDS" runat="server" ConnectionString="<%$ ConnectionStrings:Conn2000 %>"
SelectCommand="SELECT FirstName, LastName, Title FROM Employees">
</asp:SqlDataSource>
<asp:GridView runat="server" ID="myGV" DataSourceID="mySDS" AutoGenerateColumns="true">
</asp:GridView
BTW, what's the exception you got when connecting with OleDB connection? OleDB connection string can differ from SqlDataSource connection string, you can check http://www.connectionstrings.com/

Sunday, February 19, 2012

Best way to print a report.

I'm trying to figure out the best way to print the report I have.
printing in excell will sort of work for me, but my tables are to wide.
Excell has a page options setup, which will fit to 1 page wide, and shrink
my tables.
But when I do this it fits it to 1/5 of the page, making it to small to see.
I have a book which talks about a 'Print' Format, but I don't see that
listed anywhere else.Exporting to PDF is your best bet.
--
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Cindy Lee" <cindylee@.hotmail.com> wrote in message
news:u0FR$CEyEHA.4004@.tk2msftngp13.phx.gbl...
> I'm trying to figure out the best way to print the report I have.
> printing in excell will sort of work for me, but my tables are to wide.
> Excell has a page options setup, which will fit to 1 page wide, and shrink
> my tables.
> But when I do this it fits it to 1/5 of the page, making it to small to
see.
> I have a book which talks about a 'Print' Format, but I don't see that
> listed anywhere else.
>

Thursday, February 16, 2012

Best way to move databse and tlog files from default location

Thanks in advance for all help guys;
I need to figure out the best way to move files with no data loss from the
default installed location, in my case ms crm database files. When you
install MS CRM it does not give you the option if pick an install location of
files (disk placement wise).
Thanks so much,
Most applications don't care where the underlying DB files are physically
located. It probably created them on the default location. Relocating the
files will require some down time. During a time when there is no user
activity or Alter your database and set it to DBO only (use rollback
immediate if necessary). Detach the database. Copy the files. Attach the
database back. Most of this can be done with Enterprise manager by changing
the properties of the database and running tasks.
"Seth at Sherwood" <SethatSherwood@.discussions.microsoft.com> wrote in
message news:6A7AA4A6-8ECF-4CCF-837B-AB9F45709904@.microsoft.com...
> Thanks in advance for all help guys;
> I need to figure out the best way to move files with no data loss from the
> default installed location, in my case ms crm database files. When you
> install MS CRM it does not give you the option if pick an install location
> of
> files (disk placement wise).
> Thanks so much,
|||In SQL Server 2005 you can also use 'alter database set offline' and 'alter
database modify file'. See BOL 'Moving Database Files', 'Planned Relocation
Procedure' section.
Ben Nevarez
"Danny" wrote:

> Most applications don't care where the underlying DB files are physically
> located. It probably created them on the default location. Relocating the
> files will require some down time. During a time when there is no user
> activity or Alter your database and set it to DBO only (use rollback
> immediate if necessary). Detach the database. Copy the files. Attach the
> database back. Most of this can be done with Enterprise manager by changing
> the properties of the database and running tasks.
>
> "Seth at Sherwood" <SethatSherwood@.discussions.microsoft.com> wrote in
> message news:6A7AA4A6-8ECF-4CCF-837B-AB9F45709904@.microsoft.com...
>
>

Best way to move databse and tlog files from default location

Thanks in advance for all help guys;
I need to figure out the best way to move files with no data loss from the
default installed location, in my case ms crm database files. When you
install MS CRM it does not give you the option if pick an install location of
files (disk placement wise).
Thanks so much,Most applications don't care where the underlying DB files are physically
located. It probably created them on the default location. Relocating the
files will require some down time. During a time when there is no user
activity or Alter your database and set it to DBO only (use rollback
immediate if necessary). Detach the database. Copy the files. Attach the
database back. Most of this can be done with Enterprise manager by changing
the properties of the database and running tasks.
"Seth at Sherwood" <SethatSherwood@.discussions.microsoft.com> wrote in
message news:6A7AA4A6-8ECF-4CCF-837B-AB9F45709904@.microsoft.com...
> Thanks in advance for all help guys;
> I need to figure out the best way to move files with no data loss from the
> default installed location, in my case ms crm database files. When you
> install MS CRM it does not give you the option if pick an install location
> of
> files (disk placement wise).
> Thanks so much,|||In SQL Server 2005 you can also use 'alter database set offline' and 'alter
database modify file'. See BOL 'Moving Database Files', 'Planned Relocation
Procedure' section.
Ben Nevarez
"Danny" wrote:
> Most applications don't care where the underlying DB files are physically
> located. It probably created them on the default location. Relocating the
> files will require some down time. During a time when there is no user
> activity or Alter your database and set it to DBO only (use rollback
> immediate if necessary). Detach the database. Copy the files. Attach the
> database back. Most of this can be done with Enterprise manager by changing
> the properties of the database and running tasks.
>
> "Seth at Sherwood" <SethatSherwood@.discussions.microsoft.com> wrote in
> message news:6A7AA4A6-8ECF-4CCF-837B-AB9F45709904@.microsoft.com...
> > Thanks in advance for all help guys;
> >
> > I need to figure out the best way to move files with no data loss from the
> > default installed location, in my case ms crm database files. When you
> > install MS CRM it does not give you the option if pick an install location
> > of
> > files (disk placement wise).
> >
> > Thanks so much,
>
>

Best way to move databse and tlog files from default location

Thanks in advance for all help guys;
I need to figure out the best way to move files with no data loss from the
default installed location, in my case ms crm database files. When you
install MS CRM it does not give you the option if pick an install location o
f
files (disk placement wise).
Thanks so much,Most applications don't care where the underlying DB files are physically
located. It probably created them on the default location. Relocating the
files will require some down time. During a time when there is no user
activity or Alter your database and set it to DBO only (use rollback
immediate if necessary). Detach the database. Copy the files. Attach the
database back. Most of this can be done with Enterprise manager by changing
the properties of the database and running tasks.
"Seth at Sherwood" <SethatSherwood@.discussions.microsoft.com> wrote in
message news:6A7AA4A6-8ECF-4CCF-837B-AB9F45709904@.microsoft.com...
> Thanks in advance for all help guys;
> I need to figure out the best way to move files with no data loss from the
> default installed location, in my case ms crm database files. When you
> install MS CRM it does not give you the option if pick an install location
> of
> files (disk placement wise).
> Thanks so much,|||In SQL Server 2005 you can also use 'alter database set offline' and 'alter
database modify file'. See BOL 'Moving Database Files', 'Planned Relocation
Procedure' section.
Ben Nevarez
"Danny" wrote:

> Most applications don't care where the underlying DB files are physically
> located. It probably created them on the default location. Relocating th
e
> files will require some down time. During a time when there is no user
> activity or Alter your database and set it to DBO only (use rollback
> immediate if necessary). Detach the database. Copy the files. Attach th
e
> database back. Most of this can be done with Enterprise manager by changi
ng
> the properties of the database and running tasks.
>
> "Seth at Sherwood" <SethatSherwood@.discussions.microsoft.com> wrote in
> message news:6A7AA4A6-8ECF-4CCF-837B-AB9F45709904@.microsoft.com...
>
>