Showing posts with label verify. Show all posts
Showing posts with label verify. 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.

Sunday, February 19, 2012

Enterprise Manager (Import Data) - DTS Error

You must verify that SQL service is starting with a domain
ID on both SQL Servers and that whatever that Id is, it is
in the local administrators group of both server you are
getting and retriving data from.
Let me know how it goes...
Jay
>--Original Message--
>I created a new database in Enterprise Manager and then
attempted to import data into this new database from an
existing database via the "import data" option. This
launches the Data Transformation Services Import/Export
Wizard. I select the data source. I select the
destination. I select 'Copy table(s) and view(s) from
source database." I select all tables. I select the 'run
immediatedly' option. When I click the 'Finish' button, I
receive the following message in a message box
entitled 'Initialize Com:"
>Could not create an instance of the DTS Package.
>Can anyone tell me what may be wrong? This is SQL Server
2000, SP3.
>.
>
Jay,
The two databases are on the same server. One is named TablesSQL and the other is named TablesSQL_empty. Everything works fine except for the import or export data functions. I always get the "Cannot create an instance of the DTS Package" error. It ha
s worked in the past, but I have not used it in quite awhile and now every attempt produces this error.
"Jay" wrote:

> You must verify that SQL service is starting with a domain
> ID on both SQL Servers and that whatever that Id is, it is
> in the local administrators group of both server you are
> getting and retriving data from.
> Let me know how it goes...
> Jay
> attempted to import data into this new database from an
> existing database via the "import data" option. This
> launches the Data Transformation Services Import/Export
> Wizard. I select the data source. I select the
> destination. I select 'Copy table(s) and view(s) from
> source database." I select all tables. I select the 'run
> immediatedly' option. When I click the 'Finish' button, I
> receive the following message in a message box
> entitled 'Initialize Com:"
> 2000, SP3.
>

Enterprise Manager (Import Data) - DTS Error

You must verify that SQL service is starting with a domain
ID on both SQL Servers and that whatever that Id is, it is
in the local administrators group of both server you are
getting and retriving data from.
Let me know how it goes...
Jay
>--Original Message--
>I created a new database in Enterprise Manager and then
attempted to import data into this new database from an
existing database via the "import data" option. This
launches the Data Transformation Services Import/Export
Wizard. I select the data source. I select the
destination. I select 'Copy table(s) and view(s) from
source database." I select all tables. I select the 'run
immediatedly' option. When I click the 'Finish' button, I
receive the following message in a message box
entitled 'Initialize Com:"
>Could not create an instance of the DTS Package.
>Can anyone tell me what may be wrong? This is SQL Server
2000, SP3.
>.
>Jay,
The two databases are on the same server. One is named TablesSQL and the ot
her is named TablesSQL_empty. Everything works fine except for the import o
r export data functions. I always get the "Cannot create an instance of the
DTS Package" error. It ha
s worked in the past, but I have not used it in quite awhile and now every a
ttempt produces this error.
"Jay" wrote:

> You must verify that SQL service is starting with a domain
> ID on both SQL Servers and that whatever that Id is, it is
> in the local administrators group of both server you are
> getting and retriving data from.
> Let me know how it goes...
> Jay
> attempted to import data into this new database from an
> existing database via the "import data" option. This
> launches the Data Transformation Services Import/Export
> Wizard. I select the data source. I select the
> destination. I select 'Copy table(s) and view(s) from
> source database." I select all tables. I select the 'run
> immediatedly' option. When I click the 'Finish' button, I
> receive the following message in a message box
> entitled 'Initialize Com:"
> 2000, SP3.
>