Showing posts with label select. Show all posts
Showing posts with label select. Show all posts

Thursday, March 29, 2012

EOF with SqlDataSource

I am trying to get record from a table and verify it with a textbox i have a sqldatasource.

i have a text box called txtEmail and this is my Select command. how can i get this working if its possible ?

something like txtEmail.text = SqlDataSource1.Secect then ... my code. (i dont know if this a correct way to do this)

<asp:SqlDataSourceID="SqlDataSource1"runat="server"ConnectionString="<%$ ConnectionStrings:imacstestConnectionString %>"

SelectCommand="SELECTEmail FROM [t_CustomerAcct]"

thanks,

Hi,

I'm not quite clear what you want. Do you mean querying with some conditions for a return from the data table and verify if it's equal with the value from the text box or just want to make a query according the value from the text box?

If it's the first scenario, see the following sample:

 <asp:SqlDataSource ID="SqlDataSource1" runat="server" DataSourceMode="DataSet" ConnectionString="<%$ ConnectionStrings:TestConnectionString2%>" ></asp:SqlDataSource>  
SqlDataSource1.SelectCommand ="select CategoryName from Categories where CategoryID='1'";DataView dw = (DataView)SqlDataSource1.Select(DataSourceSelectArguments.Empty);string str = dw.Table.Rows[0][0].ToString();if (str ==this.TextBox1.Text) {// equal}else {// not equal}

If it's the second scenario, just make select statement according the value from textbox directly.

this.SqlDataSource1.SelectCommand ="select CategoryName from Categories where CategoryID=@.id";this.SqlDataSource1.SelectParameters.Add("id",this.TextBox1.Text); DataView dw = (DataView)SqlDataSource1.Select(DataSourceSelectArguments.Empty);string str = dw.Table.Rows[0][0].ToString();

Thanks.

Tuesday, March 27, 2012

EnumAvailableSqlServers() fails to detect LOCAL installed instance when disconnected from networ

I am using EnumAvailableSqlServer to build the standard select Sql Server dialog with controls to select the server, instance and database. This all works fine - other than the well reported problem of detected multiple instances - however I have noticed that when disconnected from the network the call fails to even detect the locally installed sql servers.

What is the recommended method of determine whether an instance of sql server is installed locally. I can call Server->Databases, but this leads to a timeout / excpetion if no instances are detected which is slow. Is there a recommended registry key I can check that won't change between versions or another API I can try.

hx, Nick

Checking registry seems the simplest ...

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server

with InstalledInstances value.

Thx, Nick

EnumAvailableSqlServers() fails to detect LOCAL installed instance when disconnected from ne

I am using EnumAvailableSqlServer to build the standard select Sql Server dialog with controls to select the server, instance and database. This all works fine - other than the well reported problem of detected multiple instances - however I have noticed that when disconnected from the network the call fails to even detect the locally installed sql servers.

What is the recommended method of determine whether an instance of sql server is installed locally. I can call Server->Databases, but this leads to a timeout / excpetion if no instances are detected which is slow. Is there a recommended registry key I can check that won't change between versions or another API I can try.

hx, Nick

Checking registry seems the simplest ...

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server

with InstalledInstances value.

Thx, Nick

Wednesday, March 21, 2012

Enterprise Manager Unknown Error

I am running SQL2000 sp3 with 819 hotfix on a 2003
Cluster. When I am on one of the database servers in the
cluster I can select from a table and get data returned.
When I am on the webserver and use EnterPrise I can see
the tables but when I try to select I get 'Unknown Error'.
The same select works from ISQL/W GUI and isql at the
command line while on the webserver.
Any ideas on what to look for would be helpful, nothing is
being logged in the eventlog or the sql log.
Thanks
Check the following;
- The MDAC version on the good and the bad machine. If possible upgrade to
the latest version of MDAC
- Capture the T-SQL command from profiler while you are try to retrieve the
data and see if you can identify the issue.
- Permissions
- The client configuration options by comparing them to the good machine.
HTH
SQL Server Support
Agnes Panosian

Friday, March 9, 2012

Enterprise Manager Hangs....

1. SQL Server 2K with Service Pack 3.x.

Steps to generate error in Enterprise Manager.

Right click on Database node, select All Tasks and Restore Database... Hourglass appears for ever.

All Tasks--> Backup Database... and All Tasks--> Attach Database... works fine.

Installed the SP4 and reinstalled the Enterprise Manager component. No help. Still the same hourglass at this stage.

2. When the above steps are repeated from other PC(Enterprise Manager), the hour glass appears. Irrespective from which EM (different PC) I run the above steps the EM hangs.

What would be the cause and remedy.

Thank you for your thoughts.

Smith

Here is the update on this issue...

Restore database window appears after long wait.... more than an hour.........

It never use to be so earlier.

What got changed recently?

SQL Server was writing the backup files(full backup, differential backup and transactional backup on UNC path) to Windows 2K Server and lately started writing to Windows Server 2003.

When the restore is selected it will list all the backup set files and its path. Is the EM taking longtime to read this list? Does the new file system is delaying the read?

Any thoughts?

Thank you,

|||

Run a trace and see what commands, statements are being executed when it hangs. That should give you more to figure out the issue.

-Sue

Enterprise Manager Hangs....

1. SQL Server 2K with Service Pack 3.x.

Steps to generate error in Enterprise Manager.

Right click on Database node, select All Tasks and Restore Database... Hourglass appears for ever.

All Tasks--> Backup Database... and All Tasks--> Attach Database... works fine.

Installed the SP4 and reinstalled the Enterprise Manager component. No help. Still the same hourglass at this stage.

2. When the above steps are repeated from other PC(Enterprise Manager), the hour glass appears. Irrespective from which EM (different PC) I run the above steps the EM hangs.

What would be the cause and remedy.

Thank you for your thoughts.

Smith

Here is the update on this issue...

Restore database window appears after long wait.... more than an hour.........

It never use to be so earlier.

What got changed recently?

SQL Server was writing the backup files(full backup, differential backup and transactional backup on UNC path) to Windows 2K Server and lately started writing to Windows Server 2003.

When the restore is selected it will list all the backup set files and its path. Is the EM taking longtime to read this list? Does the new file system is delaying the read?

Any thoughts?

Thank you,

|||

|||

|||

Run a trace and see what commands, statements are being executed when it hangs. That should give you more to figure out the issue.

-Sue

Wednesday, March 7, 2012

Enterprise Manager Error Pls Help

Hi All,
Sqlserver 7.
From the Enterprise Manager when i right click on a table
and select
Return all row. I am getting the below error
An unexpected error happened during this operation.
[Query]- Query Designer encountered a Query error:
Unspecified error
When i use Query Analyser i am able to retrive the Data
Pls help Its Urgent
TIA
HaseebIf the drive that holds the temp directory is running low on space this
error can be generated. Enterprise manager creates temporary files when it
returns all rows.
Rand
This posting is provided "as is" with no warranties and confers no rights.

Sunday, February 19, 2012

Enterprise Manager 2000 vs 2005

Maybe I just haven't found the right place yet, but...
1. In 2000 you could hold down the control key, select several tables and
script them out into 1 file... why doesn't this work in 2005 (or how do you
do it in 2005) ?
2. In 2000 you could right click on a table and quickly export its
contents... how in 2005 ?
When using SSIS...
So I connect to Integration services... I expand my stored packages... MSDB
folder... I see the packages there... Is there a way to "open them" in
design view from EM ?
Thanks !Hi Rob
"Rob" wrote:
> Maybe I just haven't found the right place yet, but...
> 1. In 2000 you could hold down the control key, select several tables and
> script them out into 1 file... why doesn't this work in 2005 (or how do you
> do it in 2005) ?
You can script multiple objects by clicking the database then choosing
task/generate scripts and choose from them, a mixture of multiple objects of
different types can be chosen.
> 2. In 2000 you could right click on a table and quickly export its
> contents... how in 2005 ?
Again at database level, tasks and export data to get the wizard..
> When using SSIS...
> So I connect to Integration services... I expand my stored packages... MSDB
> folder... I see the packages there... Is there a way to "open them" in
> design view from EM ?
No, you need to used BIDS ( SQL Server Business Intelligence Development
Studio )
> Thanks !
>
John|||Thanks for the response John...
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:DEF8B71A-5370-4A3F-899C-B8D8D3296D0B@.microsoft.com...
> Hi Rob
> "Rob" wrote:
>> Maybe I just haven't found the right place yet, but...
>> 1. In 2000 you could hold down the control key, select several tables and
>> script them out into 1 file... why doesn't this work in 2005 (or how do
>> you
>> do it in 2005) ?
> You can script multiple objects by clicking the database then choosing
> task/generate scripts and choose from them, a mixture of multiple objects
> of
> different types can be chosen.
>> 2. In 2000 you could right click on a table and quickly export its
>> contents... how in 2005 ?
> Again at database level, tasks and export data to get the wizard..
>> When using SSIS...
>> So I connect to Integration services... I expand my stored packages...
>> MSDB
>> folder... I see the packages there... Is there a way to "open them" in
>> design view from EM ?
> No, you need to used BIDS ( SQL Server Business Intelligence Development
> Studio )
>> Thanks !
> John

Enterprise Manager 2000 vs 2005

Maybe I just haven't found the right place yet, but...
1. In 2000 you could hold down the control key, select several tables and
script them out into 1 file... why doesn't this work in 2005 (or how do you
do it in 2005) ?
2. In 2000 you could right click on a table and quickly export its
contents... how in 2005 ?
When using SSIS...
So I connect to Integration services... I expand my stored packages... MSDB
folder... I see the packages there... Is there a way to "open them" in
design view from EM ?
Thanks !
Hi Rob
"Rob" wrote:

> Maybe I just haven't found the right place yet, but...
> 1. In 2000 you could hold down the control key, select several tables and
> script them out into 1 file... why doesn't this work in 2005 (or how do you
> do it in 2005) ?
You can script multiple objects by clicking the database then choosing
task/generate scripts and choose from them, a mixture of multiple objects of
different types can be chosen.
> 2. In 2000 you could right click on a table and quickly export its
> contents... how in 2005 ?
Again at database level, tasks and export data to get the wizard..

> When using SSIS...
> So I connect to Integration services... I expand my stored packages... MSDB
> folder... I see the packages there... Is there a way to "open them" in
> design view from EM ?
No, you need to used BIDS ( SQL Server Business Intelligence Development
Studio )

> Thanks !
>
John
|||Thanks for the response John...
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:DEF8B71A-5370-4A3F-899C-B8D8D3296D0B@.microsoft.com...
> Hi Rob
> "Rob" wrote:
> You can script multiple objects by clicking the database then choosing
> task/generate scripts and choose from them, a mixture of multiple objects
> of
> different types can be chosen.
> Again at database level, tasks and export data to get the wizard..
> No, you need to used BIDS ( SQL Server Business Intelligence Development
> Studio )
> John

Enterprise Manager 2000 vs 2005

Maybe I just haven't found the right place yet, but...
1. In 2000 you could hold down the control key, select several tables and
script them out into 1 file... why doesn't this work in 2005 (or how do you
do it in 2005) ?
2. In 2000 you could right click on a table and quickly export its
contents... how in 2005 ?
When using SSIS...
So I connect to Integration services... I expand my stored packages... MSDB
folder... I see the packages there... Is there a way to "open them" in
design view from EM ?
Thanks !Hi Rob
"Rob" wrote:

> Maybe I just haven't found the right place yet, but...
> 1. In 2000 you could hold down the control key, select several tables and
> script them out into 1 file... why doesn't this work in 2005 (or how do y
ou
> do it in 2005) ?
You can script multiple objects by clicking the database then choosing
task/generate scripts and choose from them, a mixture of multiple objects of
different types can be chosen.
> 2. In 2000 you could right click on a table and quickly export its
> contents... how in 2005 ?
Again at database level, tasks and export data to get the wizard..

> When using SSIS...
> So I connect to Integration services... I expand my stored packages... MSD
B
> folder... I see the packages there... Is there a way to "open them" in
> design view from EM ?
No, you need to used BIDS ( SQL Server Business Intelligence Development
Studio )

> Thanks !
>
John|||Thanks for the response John...
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:DEF8B71A-5370-4A3F-899C-B8D8D3296D0B@.microsoft.com...
> Hi Rob
> "Rob" wrote:
>
> You can script multiple objects by clicking the database then choosing
> task/generate scripts and choose from them, a mixture of multiple objects
> of
> different types can be chosen.
> Again at database level, tasks and export data to get the wizard..
>
> No, you need to used BIDS ( SQL Server Business Intelligence Development
> Studio )
>
> John

enterprise manager "return all rows" error

in enterprise manager, when i select a table and "return all rows" or "query" , SQL returns an error "provider cannot be found". I can successfully run a query in query analyzer. I've reinstalled SQL and it's still not working. It seemed to be working fine a couple weeks ago when i was working on crystal reports.Hi,
It could be an MDAC problem. Try loading the MDAC for the version of SQL
you are using.
I hope this helps
regards
Greg O MCSD
http://www.ag-software.com/ags_scribe_index.aspx. SQL Scribe Documentation
Builder, the quickest way to document your database
http://www.ag-software.com/ags_SSEPE_index.aspx. AGS SQL Server Extended
Property Extended properties manager for SQL 2000
http://www.ag-software.com/IconExtractionProgram.aspx . Free icon extraction
program
http://www.ag-software.com. Free programming tools
"az" <anonymous@.discussions.microsoft.com> wrote in message
news:8E3D5D69-C0E8-43D6-BE2C-8D24DE519A6D@.microsoft.com...
> in enterprise manager, when i select a table and "return all rows" or
"query" , SQL returns an error "provider cannot be found". I can
successfully run a query in query analyzer. I've reinstalled SQL and it's
still not working. It seemed to be working fine a couple weeks ago when i
was working on crystal reports.
>