Showing posts with label errors. Show all posts
Showing posts with label errors. Show all posts

Thursday, March 29, 2012

data table foriegn key problem

I am just learning how to program in SQL, so please be patient with me

ok, here it is, i am getting the following errors with my script when i try to execute, and although i realize that this is not the best style to write my script in, i am trying to learn why this is erroring. the errors are:

Msg 1769, Level 16, State 1, Line 9

Foreign key 'Employee2Job_Title' references invalid column 'Title' in referencing table 'Employee'.

Msg 1750, Level 16, State 0, Line 9

Could not create constraint. See previous errors.

now i realize that the second error is because of the first, and that if i can fix the first, the second will go away. Thanks for the help.

Here is my script

use inventory

go

CREATE TABLE Job_Title

(Job_Title_Title char(25) NOT NULL ,

Job_Title_EEO1_Classification char(25) ,

Job_Title_Job_Description Varchar(45) ,

Job_Title_Exempt_Status Varchar(15)

, PRIMARY KEY (Job_Title_Title)

);

CREATE TABLE Employee

(Employee_Emp_ID integer NOT NULL ,

Employee_last_name varchar(15) ,

Employee_first_name varchar(15) ,

Employee_address varchar(30) ,

Employee_city varchar(15) ,

Employee_state char(2) ,

Employee_Telephone_area_code char(3) ,

Employee_Telephone_number char(8) ,

Employee_EEO1_Classification char(25) ,

Employee_Hire_Date char(8) ,

Employee_Salary char(6) ,

Employee_Gender Varchar(1) ,

Employee_Age char(2) ,

Employee_Title char(25)

, PRIMARY KEY (Employee_Emp_ID)

, constraint Employee2Job_Title FOREIGN KEY (Title

) REFERENCES Job_Title

);

Insert INTO Employee (Emp_ID, Last_name, First_name, Address, City, State, Telephone_area_code, Telephone_number, EEO1_Classification, Hire_date, Salary, Gender, Age, Title) Values

(1, 'Edelman', 'Glenn', '175 Bishop Lane', 'La Jolla', 'CA', 619, '555-0199', 'Sales Workers', 10/7/2003, 21500.00, 'M', 64, 'Cashier')

Insert INTO Employee (Emp_ID, Last_name, First_name, Address, City, State, Telephone_area_code, Telephone_number, EEO1_Classification, Hire_date, Salary, Gender, Age, Title) Values

(2, 'McMullen', 'Eric', '762 Church Street', 'Lemon Grove', 'CA', 619, '555-0133', 'Sales Workers', 11/1/2002, 13500.00, 'M', 20, 'Bagger')

Insert INTO Employee (Emp_ID, Last_name, First_name, Address, City, State, Telephone_area_code, Telephone_number, EEO1_Classification, Hire_date, Salary, Gender, Age, Title) Values

(3, 'Slenj', 'Raj', '123 Torrey Drive', 'North Clairmont', 'CA', 619, '555-0123', 'Officials & Managers', 6/1/2000, 48000.00, 'M', 34, 'Assistant Manager')

Insert INTO Employee (Emp_ID, Last_name, First_name, Address, City, State, Telephone_area_code, Telephone_number, EEO1_Classification, Hire_date, Salary, Gender, Age, Title) Values

(4, 'Broun', 'Erin', '2045 Parkway Apt 2b', 'Encinitas', 'CA', 760, '555-0100', 'Sales Workers', 3/12/2003, 10530.00, 'F', 24, 'Bagger - 30 hours/wk')

Insert INTO Employee (Emp_ID, Last_name, First_name, Address, City, State, Telephone_area_code, Telephone_number, EEO1_Classification, Hire_date, Salary, Gender, Age, Title) Values

(5, 'Carpenter', 'Donald', '927 Second Street', 'Encinitas', 'CA', 619, '555-0154', 'Office/Clerical', 11/1/2003, 15000.00, 'M', 18, 'Stocker')

Insert INTO Employee (Emp_ID, Last_name, First_name, Address, City, State, Telephone_area_code, Telephone_number, EEO1_Classification, Hire_date, Salary, Gender, Age, Title) Values

(6, 'Esquivez', 'David', '10983 North Coast Highway Apt 902', 'Encinitas', 'CA', 760, '555-0108', 'Operatives (Semi skilled)', 7/25/2003, 18500.00, 'M',25, 'Asst. - Butchers & Seafood Specialists')

Insert INTO Employee (Emp_ID, Last_name, First_name, Address, City, State, Telephone_area_code, Telephone_number, EEO1_Classification, Hire_date, Salary, Gender, Age, Title) Values

(7, 'Sharp', 'Nancy', '10793 Montecino Road', 'Ramona', 'CA', 858, '555-0135', 'Sales Workers', 7/12/2003, 21000.00, 'F', 24, 'Cashier')

Insert into Job_Title (Title, EEO1_Classification, Job_Description, Exempt_Status) Values

('Accounting Clerk', 'Office/Clerical', 'Computes, Classifies, records, and verifies numerical data for use in maintaining accounting records.', 'Non-Exempt')

Insert into Job_Title (Title, EEO1_Classification, Job_Description, Exempt_Status) Values

('Assistant store manager', 'Officials & Mangers', 'Supervises and coordintes activities of workers in department of food store. Assist store manager in daily operations of store.', 'Exempt')

Insert into Job_Title (Title, EEO1_Classification, Job_Description, Exempt_Status) Values

('Bagger', 'Sales Worker', 'Places customer orders in bags. Performs carry out duties for customers.', 'Non-Exempt')

Insert into Job_Title (Title, EEO1_Classification, Job_Description, Exempt_Status) Values

('Cashier', 'Sales Worker', 'Operates Cash register to itemize and total customers purchases in grocercy store', 'Non-Exempt')

Insert into Job_Title (Title, EEO1_Classification, Job_Description, Exempt_Status) Values

('Computer Support Specialist', 'Technician', 'Installs, Modifies, and makes minor repairs to personal computer hardware and software systems and provides technical assistance and training to system users.', 'Non-Exempt')

Insert into Job_Title (Title, EEO1_Classification, Job_Description, Exempt_Status) Values

('Director of Finance & Accounting', 'Officials & Mangers', 'Plans and directs finance and accounting activites for Kudlser Fine Foods.', 'Non-Exempt')

Insert into Job_Title (Title, EEO1_Classification, Job_Description, Exempt_Status) Values

('Retail Asst. Bakery & Pastry', 'Craft Workers (Skilled)', 'Obtains or prepares Bakery and Pastry items requested by customers in retail food store.', 'Non-Exempt')

Insert into Job_Title (Title, EEO1_Classification, Job_Description, Exempt_Status) Values

('Retail Asst. Butchers and Seafood Specialists', 'Operatives (Semi skilled)', 'Obtains or prepares Meat and Seafood items requested by customers in retail food store.', 'Non-Exempt')

Insert into Job_Title (Title, EEO1_Classification, Job_Description, Exempt_Status) Values

('Stocker', 'Office/Clerical', 'Stores, prices, and restocks merchandise displays in store.', 'Non-Exempt')

In your foreign key that you are creating with:

constraint Employee2Job_Title FOREIGN KEY (Title) REFERENCES Job_Title

The column named Title needs to exist in the Employee table on which you are creating the constraint. Then for the column it points to with the REFERENCES part, the needs to be in the format of ReferenceTable(ReferenceTableColumnName)

If I'm guessing right at your tables, I think what you are looking for is more along the lines of

constraint Employee2Job_Title FOREIGN KEY (Employee_Title) REFERENCES Job_Title(Job_Title_Title)

-Sue

|||ok, here is the code i ended up with that cured that problem

CREATE TABLE Job_Title
(Job_Title_Title char(25) NOT NULL ,
Job_Title_EEO1_Classification char(25) ,
Job_Title_Job_Description Varchar(45) ,
Job_Title_Exempt_Status Varchar(15)
, PRIMARY KEY (Job_Title_Title)
);

CREATE TABLE Employee
(Employee_Emp_ID integer NOT NULL ,
Employee_last_name varchar(15) ,
Employee_first_name varchar(15) ,
Employee_address varchar(30) ,
Employee_city varchar(15) ,
Employee_state char(2) ,
Employee_Telephone_area_code char(3) ,
Employee_Telephone_number char(8) ,
Employee_EEO1_Classification char(25) ,
Employee_Hire_Date char(8) ,
Employee_Salary char(6) ,
Employee_Gender Varchar(1) ,
Employee_Age char(2) ,
Employee_Title char(25)
, PRIMARY KEY (Employee_Emp_ID)
, constraint Employee2Job_Title FOREIGN KEY (Employee_Title
) REFERENCES Job_Title
);

but now i am on to new and even more frustrating errors, and i will do some work on them myself, on the morrow, then if i am still having problems, i will again avail myself of this resource.

thanks much sue, your assistance has been invaluable!sql

Sunday, March 25, 2012

Data Source / ODBC error

Hi all,

My replication of those SQL 2000 servers gave errors: Data source (11): General Network Error. Check your network documentation... and ODBC (08S01): Communication link failure. The replication was across the WAN. I don't know where to start to troubleshoot this problem. Please help!

Thanks in advance.

John

Communication link failure means some network or communication problem between the Publisher/Distributor and Subscriber. Check the connection between them. Try connecting to the other servers from each of the servers and ensure that you are able to connect and then retry the Sync.

Also note for any firewalls that need to be taken care of or if the ports are different or enabled.

See if the domains are different and if so ensure trust or use SQL authentication.

Also is this the first time the sync ran or it previously used to succeed?

|||

Hi,

This is not the first time the replication failed. It worked perfect before.

DNS is fine since I did check.

Since this is a site to site interconnected (site2site VPN across internet). Therefore, the domains are different.

It has failed several times a day.

I don't know if we have any testing tools for replication available so I can narrow down the problems and troubleshoot more efficiently.

thanks much for your help!!!

|||This mostly has to do with network connectivity then. For merge agent to run successfully, the connection needs to be established. Try rerunning it and see if it succeeds. Also see if there are any other external factors affecting the connection. Peak load, network flakiness, disconnects or downtime during certain periods of time etc.|||On the machine where the failure occurred, try creating a UDL file (create a new text document, then rename it to "test.udl"). Open the UDL file by double-clicking it, then try to establish a connection to your database using the same sorts of parameters (ie provider [SQL Server native / ODBC etc.], server name, login parameters). You can use this to narrow down the cause of the problem (eg. whether it's the DB provider, or a lack of connectivity which can be checked using other means such as a traceroute etc.).|||

Thanks much. I will implement this method. In the meantime, is the packet from replication UDP or TCP when it is sent to the subcribed machine from distributed machine. I have thought my network is being flooding at the switch before data reached the nodes of the cluster. Therefore, it is redirected elsewhere but the destination. What I did was trying to send data from host inside network through that switch to the gateway...and I was only successful 35%. This means packets drops no matter incoming or outgoing through that switch.

Having some methods to test the replication directly will help a lot.

Thanks for your helps, guys.

|||Doesn't UDP run on top of TCP, hence they're both going to be TCP? Also, it'd depend on whether you've got the IIS machine on the Publisher machine, the Subscriber machine, or another machine?
Also try playing around with the configuration of the Client/Server Network Protocol - if you're having problems using TCP/IP, then try using Named Pipes instead. Make sure to configure this on both the publisher and subscriber machine.|||

Problem Fixed, Guys. It was just network problem. The Fixwall is misconfigured so that it operated half duplex instead of full. There Ain't nothin to do with the replication!!!

However, I have to deal with new problem......queue reader failed with the error message: Queue reader aborting. The steps failed. What does it mean? Where should I start to troubleshoot this error?

Thanks a lot!

|||Is there anything more helpful in the Event log?|||What I 've got is Failed while applying queued message to publisher!|||

I'm not an expert in SQL Server replication, so I can't help you more with your specific error (I've just recently spent a few days reading lots about SQL Mobile replication, hence the reason I came across your post).

If I was in your position, however, I'd start by getting everything working on on one box (even if it's just a staging box), and once it all works, you can move bit by bit elsewhere (eg. Publisher DB / IIS virtual dir / IIS server / Subscriber DB).

As you try to move things bit by bit you'll realise where the problem is. Sometimes the 'longest' way is the shortest because by being systematic, you don't end up pulling your hair out looking at something that 'should work', but doesn't!

|||

Oh, by the way, if you can't get it to work, I suggest starting a new thread, because some people will see this thread as answered, and not read it.

Cheers.

sql

Data Source / ODBC error

Hi all,

My replication of those SQL 2000 servers gave errors: Data source (11): General Network Error. Check your network documentation... and ODBC (08S01): Communication link failure. The replication was across the WAN. I don't know where to start to troubleshoot this problem. Please help!

Thanks in advance.

John

Communication link failure means some network or communication problem between the Publisher/Distributor and Subscriber. Check the connection between them. Try connecting to the other servers from each of the servers and ensure that you are able to connect and then retry the Sync.

Also note for any firewalls that need to be taken care of or if the ports are different or enabled.

See if the domains are different and if so ensure trust or use SQL authentication.

Also is this the first time the sync ran or it previously used to succeed?

|||

Hi,

This is not the first time the replication failed. It worked perfect before.

DNS is fine since I did check.

Since this is a site to site interconnected (site2site VPN across internet). Therefore, the domains are different.

It has failed several times a day.

I don't know if we have any testing tools for replication available so I can narrow down the problems and troubleshoot more efficiently.

thanks much for your help!!!

|||This mostly has to do with network connectivity then. For merge agent to run successfully, the connection needs to be established. Try rerunning it and see if it succeeds. Also see if there are any other external factors affecting the connection. Peak load, network flakiness, disconnects or downtime during certain periods of time etc.|||On the machine where the failure occurred, try creating a UDL file

(create a new text document, then rename it to "test.udl"). Open the

UDL file by double-clicking it, then try to establish a connection to

your database using the same sorts of parameters (ie provider [SQL

Server native / ODBC etc.], server name, login parameters). You can use

this to narrow down the cause of the problem (eg. whether it's the DB

provider, or a lack of connectivity which can be checked using other

means such as a traceroute etc.).|||

Thanks much. I will implement this method. In the meantime, is the packet from replication UDP or TCP when it is sent to the subcribed machine from distributed machine. I have thought my network is being flooding at the switch before data reached the nodes of the cluster. Therefore, it is redirected elsewhere but the destination. What I did was trying to send data from host inside network through that switch to the gateway...and I was only successful 35%. This means packets drops no matter incoming or outgoing through that switch.

Having some methods to test the replication directly will help a lot.

Thanks for your helps, guys.

|||Doesn't UDP run on top of TCP, hence they're both going to be TCP?

Also, it'd depend on whether you've got the IIS machine on the

Publisher machine, the Subscriber machine, or another machine?

Also try playing around with the configuration of the Client/Server

Network Protocol - if you're having problems using TCP/IP, then try

using Named Pipes instead. Make sure to configure this on both the

publisher and subscriber machine.|||

Problem Fixed, Guys. It was just network problem. The Fixwall is misconfigured so that it operated half duplex instead of full. There Ain't nothin to do with the replication!!!

However, I have to deal with new problem......queue reader failed with the error message: Queue reader aborting. The steps failed. What does it mean? Where should I start to troubleshoot this error?

Thanks a lot!

|||Is there anything more helpful in the Event log?|||What I 've got is Failed while applying queued message to publisher!|||

I'm not an expert in SQL Server replication, so I can't help you more with your specific error (I've just recently spent a few days reading lots about SQL Mobile replication, hence the reason I came across your post).

If I was in your position, however, I'd start by getting everything working on on one box (even if it's just a staging box), and once it all works, you can move bit by bit elsewhere (eg. Publisher DB / IIS virtual dir / IIS server / Subscriber DB).

As you try to move things bit by bit you'll realise where the problem is. Sometimes the 'longest' way is the shortest because by being systematic, you don't end up pulling your hair out looking at something that 'should work', but doesn't!

|||

Oh, by the way, if you can't get it to work, I suggest starting a new thread, because some people will see this thread as answered, and not read it.

Cheers.

Data Source / ODBC error

Hi all,

My replication of those SQL 2000 servers gave errors: Data source (11): General Network Error. Check your network documentation... and ODBC (08S01): Communication link failure. The replication was across the WAN. I don't know where to start to troubleshoot this problem. Please help!

Thanks in advance.

John

Communication link failure means some network or communication problem between the Publisher/Distributor and Subscriber. Check the connection between them. Try connecting to the other servers from each of the servers and ensure that you are able to connect and then retry the Sync.

Also note for any firewalls that need to be taken care of or if the ports are different or enabled.

See if the domains are different and if so ensure trust or use SQL authentication.

Also is this the first time the sync ran or it previously used to succeed?

|||

Hi,

This is not the first time the replication failed. It worked perfect before.

DNS is fine since I did check.

Since this is a site to site interconnected (site2site VPN across internet). Therefore, the domains are different.

It has failed several times a day.

I don't know if we have any testing tools for replication available so I can narrow down the problems and troubleshoot more efficiently.

thanks much for your help!!!

|||This mostly has to do with network connectivity then. For merge agent to run successfully, the connection needs to be established. Try rerunning it and see if it succeeds. Also see if there are any other external factors affecting the connection. Peak load, network flakiness, disconnects or downtime during certain periods of time etc.|||On the machine where the failure occurred, try creating a UDL file

(create a new text document, then rename it to "test.udl"). Open the

UDL file by double-clicking it, then try to establish a connection to

your database using the same sorts of parameters (ie provider [SQL

Server native / ODBC etc.], server name, login parameters). You can use

this to narrow down the cause of the problem (eg. whether it's the DB

provider, or a lack of connectivity which can be checked using other

means such as a traceroute etc.).|||

Thanks much. I will implement this method. In the meantime, is the packet from replication UDP or TCP when it is sent to the subcribed machine from distributed machine. I have thought my network is being flooding at the switch before data reached the nodes of the cluster. Therefore, it is redirected elsewhere but the destination. What I did was trying to send data from host inside network through that switch to the gateway...and I was only successful 35%. This means packets drops no matter incoming or outgoing through that switch.

Having some methods to test the replication directly will help a lot.

Thanks for your helps, guys.

|||Doesn't UDP run on top of TCP, hence they're both going to be TCP?

Also, it'd depend on whether you've got the IIS machine on the

Publisher machine, the Subscriber machine, or another machine?

Also try playing around with the configuration of the Client/Server

Network Protocol - if you're having problems using TCP/IP, then try

using Named Pipes instead. Make sure to configure this on both the

publisher and subscriber machine.|||

Problem Fixed, Guys. It was just network problem. The Fixwall is misconfigured so that it operated half duplex instead of full. There Ain't nothin to do with the replication!!!

However, I have to deal with new problem......queue reader failed with the error message: Queue reader aborting. The steps failed. What does it mean? Where should I start to troubleshoot this error?

Thanks a lot!

|||Is there anything more helpful in the Event log?|||What I 've got is Failed while applying queued message to publisher!|||

I'm not an expert in SQL Server replication, so I can't help you more with your specific error (I've just recently spent a few days reading lots about SQL Mobile replication, hence the reason I came across your post).

If I was in your position, however, I'd start by getting everything working on on one box (even if it's just a staging box), and once it all works, you can move bit by bit elsewhere (eg. Publisher DB / IIS virtual dir / IIS server / Subscriber DB).

As you try to move things bit by bit you'll realise where the problem is. Sometimes the 'longest' way is the shortest because by being systematic, you don't end up pulling your hair out looking at something that 'should work', but doesn't!

|||

Oh, by the way, if you can't get it to work, I suggest starting a new thread, because some people will see this thread as answered, and not read it.

Cheers.

Tuesday, March 20, 2012

Data read is so slow

I have a table with 3.5 million records and 50 columns. Users have been
complaining that they get ODBC errors when trying to run any query from MS
Access against this table. I created a view few fewer columns (about 25).
When I test it by doing select * from viewx in the query analyzer on my local
machine it takes 14 minutes (slams my machine) to get back the whole dataset.
What could be happening.
Comments Please.
Thank you
Bringing back 3.5 million rows will take time. Who could make use of such many rows.
Start by retrieving only the data you need, then tune the query by adding indexes etc to get better
execution times.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"helpplease" <helpplease@.discussions.microsoft.com> wrote in message
news:D1F44BC4-6478-4155-B9FF-5F6AF1A030E8@.microsoft.com...
>I have a table with 3.5 million records and 50 columns. Users have been
> complaining that they get ODBC errors when trying to run any query from MS
> Access against this table. I created a view few fewer columns (about 25).
> When I test it by doing select * from viewx in the query analyzer on my local
> machine it takes 14 minutes (slams my machine) to get back the whole dataset.
> What could be happening.
> Comments Please.
> Thank you
|||Do you have the WHERE clause in you SELECT ?
Please, post the execution plan for your query.
** * Esta msg foi útil pra você ? Ent?o marque-a como tal. ***
Regards,
Rodrigo Fernandes
"helpplease" wrote:

> I have a table with 3.5 million records and 50 columns. Users have been
> complaining that they get ODBC errors when trying to run any query from MS
> Access against this table. I created a view few fewer columns (about 25).
> When I test it by doing select * from viewx in the query analyzer on my local
> machine it takes 14 minutes (slams my machine) to get back the whole dataset.
> What could be happening.
> Comments Please.
> Thank you

Data read is so slow

I have a table with 3.5 million records and 50 columns. Users have been
complaining that they get ODBC errors when trying to run any query from MS
Access against this table. I created a view few fewer columns (about 25).
When I test it by doing select * from viewx in the query analyzer on my loca
l
machine it takes 14 minutes (slams my machine) to get back the whole dataset
.
What could be happening.
Comments Please.
Thank youBringing back 3.5 million rows will take time. Who could make use of such ma
ny rows.
Start by retrieving only the data you need, then tune the query by adding in
dexes etc to get better
execution times.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"helpplease" <helpplease@.discussions.microsoft.com> wrote in message
news:D1F44BC4-6478-4155-B9FF-5F6AF1A030E8@.microsoft.com...
>I have a table with 3.5 million records and 50 columns. Users have been
> complaining that they get ODBC errors when trying to run any query from MS
> Access against this table. I created a view few fewer columns (about 25).
> When I test it by doing select * from viewx in the query analyzer on my lo
cal
> machine it takes 14 minutes (slams my machine) to get back the whole datas
et.
> What could be happening.
> Comments Please.
> Thank you|||Do you have the WHERE clause in you SELECT ?
Please, post the execution plan for your query.
** * Esta msg foi útil pra você ? Ent?o marque-a como tal. ***
Regards,
Rodrigo Fernandes
"helpplease" wrote:

> I have a table with 3.5 million records and 50 columns. Users have been
> complaining that they get ODBC errors when trying to run any query from MS
> Access against this table. I created a view few fewer columns (about 25).
> When I test it by doing select * from viewx in the query analyzer on my lo
cal
> machine it takes 14 minutes (slams my machine) to get back the whole datas
et.
> What could be happening.
> Comments Please.
> Thank you

Data read is so slow

I have a table with 3.5 million records and 50 columns. Users have been
complaining that they get ODBC errors when trying to run any query from MS
Access against this table. I created a view few fewer columns (about 25).
When I test it by doing select * from viewx in the query analyzer on my local
machine it takes 14 minutes (slams my machine) to get back the whole dataset.
What could be happening.
Comments Please.
Thank youBringing back 3.5 million rows will take time. Who could make use of such many rows.
Start by retrieving only the data you need, then tune the query by adding indexes etc to get better
execution times.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"helpplease" <helpplease@.discussions.microsoft.com> wrote in message
news:D1F44BC4-6478-4155-B9FF-5F6AF1A030E8@.microsoft.com...
>I have a table with 3.5 million records and 50 columns. Users have been
> complaining that they get ODBC errors when trying to run any query from MS
> Access against this table. I created a view few fewer columns (about 25).
> When I test it by doing select * from viewx in the query analyzer on my local
> machine it takes 14 minutes (slams my machine) to get back the whole dataset.
> What could be happening.
> Comments Please.
> Thank you|||Do you have the WHERE clause in you SELECT ?
Please, post the execution plan for your query.
--
** * Esta msg foi útil pra você ? Então marque-a como tal. ***
Regards,
Rodrigo Fernandes
"helpplease" wrote:
> I have a table with 3.5 million records and 50 columns. Users have been
> complaining that they get ODBC errors when trying to run any query from MS
> Access against this table. I created a view few fewer columns (about 25).
> When I test it by doing select * from viewx in the query analyzer on my local
> machine it takes 14 minutes (slams my machine) to get back the whole dataset.
> What could be happening.
> Comments Please.
> Thank you

Sunday, March 11, 2012

Data not displaying (in DataList) from SQL on GoDaddy

Everything works great on my development box. I am using GoDaddy for production (ASP.Net v2, SQL 2000).

I am not receiving any errors, so I am stumped; no data from the database is displaying on the GoDaddy pages.

I updated the connection string in web.config to this:

<addname="snsb"connectionString="

Server=whsql-vXX.prod.mesaX.secureserver.net;

Database=DB_42706;

User ID=username;

Password=pw;

Trusted_Connection=False

"providerName="System.Data.SqlClient" / >

But I am unsure if this is the issue?? Any insights? This is the page I am working on:www.sugarandspicebakery.com/demo/bakery/default.aspx. So, the page displays fine, but it should be showing data from the database. This particular page uses a DataList with ItemTemplate. There is definitely data in the database, and I have even ran the same exact query from the code using the Query Analayzer on GoDaddt and it returned results

I know there isn't much info to go by, but I am hoping someone has some insight since I have been trying to figure this out for days now!

Thank you

JenniferPost the code that you bind the datalist with the data source.
|||

Here is the code:

<asp:SqlDataSourceID="snsb"runat="server"ConnectionString="<%$ ConnectionStrings:snsb %>"SelectCommand="SELECT [itemNumber], [name], [shortDescription], [category], [imageFileName] FROM [snsb] WHERE ([category] = @.category)"EnableCaching="true"><SelectParameters><asp:QueryStringParameterDefaultValue="Cakes"Name="category"QueryStringField="cat"Type="String"/>
</SelectParameters></asp:SqlDataSource><asp:DataListID="DataList1"runat="server"RepeatColumns="3"RepeatDirection="Horizontal"CellPadding="25"AlternatingItemStyle-BorderWidth="1"DataSourceID="snsb"><ItemTemplate>

<asp:HyperLinkID="HyperLink1"runat="server"NavigateUrl='<%# "~/bakery/item.aspx?item=" + Eval("itemNumber") %>'>
<asp:Imagerunat="server"BorderColor="#000000"BorderStyle="solid"BorderWidth="1"ImageUrl='<%# "../images/page/" + Eval("itemNumber") + "_a.jpg" %>'Width="123"Height="82"/></asp:HyperLink><br/>
<%# Eval("name") %><br/>
<%# Eval("shortDescription") %>
</ItemTemplate></asp:DataList>

Sorry it looks all over the place here on the forum, the insert code option doesn't appear to be working correctly.

Thanks,

Jennifer