|
Thank you for the help.
Steve Vondras
Red Lake Nation
MIS Tech
svondras@redlakenation.org
|
|
|
|
|
No problem, Steve.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
Hi all!
I've a SQL (2005) database that is structured as follows:
- a schema called "salary"
- the table name is given by the year and the effective table name. Example 2007.employees
- that gives the table name salary.[2007.employees]
In my project I've created a typed dataset with the wizard. I've then renamed the table name in the dataset without the year (ex. 2007.employees -> employees).
In the application I can choose in which year to work and should load the data from the choosen year in the dataset. I should have the possibiltiy to pass to the tabeladapter the year I want. How can I do that?
Thanks for suggestions!
Jörg
|
|
|
|
|
I think you look in the properties of the data adapter and include parameters.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Yes it's possible the add parameters in the table adapter, but not for the table names. When you try to add a paramter for the table name, the query builder gives an error.
I'm now thinking to add a column "Year" in each table, so that each row is allocated in a year and all data is in one table and database.
|
|
|
|
|
Hello
How can I cancel inner join between two tables if the value in second table not exists ..
to be more clear
TableA
-Col1
-Col2
-Col3
TableB
-Col1
-Col2
-Col3
-Col9
select TableA.col1 ,TableA.col2 ,TableB.Col1
where TableA.col3=TableB.Col9
the result will diplay if the match happend I have tried to do like this
in
TableA.col3=isNull(TableB.Col9,TableA.col3)
or something like that..
the problem that I face in sqlDataSource in asp.net
aj123
|
|
|
|
|
I did not understand your question but i guess you are looking for: 'coalesce' - try this out
Gautham
|
|
|
|
|
Use the INNER JOIN syntax.
SELECT a.Col1, a.Col2 FROM TableA a
INNER JOIN TableB b
ON b.FK_Field = a.PK_Field This will return you rows where items are present in both tables only.
|
|
|
|
|
Use a left join:
select TableA.col1 ,TableA.col2 ,TableB.Col1<br />
From TableA<br />
inner join TableB on TableA.col3=TableB.Col9
Wout Louwers
|
|
|
|
|
yes that right..
I forget that...
aj123
|
|
|
|
|
Hi
I stuck at an INSERT Query using two tables.
I have two tables Table1 and Table2.In Table1 I have 2 columns,one with dupicate value and another with null values.In Table2 I have 2 columns,both the columns have unique values.
Now I have to INSERT values from Table2 to Table1 with the corresponding or maching values like
Table1
StateCode StateName
--------- ----------
AK NULL
AK NULL
AK NULL
AL NULL
AL NULL
AL NULL
CO NULL
CO NULL
CO NULL
Table2
StateCode StateName
--------- ----------
AK Alaska
AL Alabama
AR Arkansas
AZ Arizona
CA California
CO Colorado
I have to INSERT values into Table1 in the null column from Table2 w.r.t StateCode.
Help me
Suggest me an example.
I have not failed. I've just found 10,000 ways that won't work. -Thomas A. Edison
Thank u
Chandu
|
|
|
|
|
Hi Chandu
Sounds like you need to "update". Something like:
update Table1 set StateName = Table2.StateName
from Table2
where Table2.StateCode = Table1.StateCode Regards
Andy
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message".
|
|
|
|
|
i was trying to analyze this error.....
i want to know this error is due to frontend or backend.....
i just want the solution for this error in Frontend or backend....
dasdfsadfvasdcvasd
|
|
|
|
|
Is the field a primary key?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
I tried a query
SELECT *
FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\TestSheet.xls',
'SELECT * FROM [Sheet1$]')
but its giving me error either sheet1 not found or syntax error near ')'
unable to find out the base of problem. Plz suggest me the perfect query that could be able to fetch data from excel sheet. I implemented it through front end (VB.NET) and its working properly but this time i need to write a stored procedure for the same.
With Thanks & Regards
Amit Sk Sharma
|
|
|
|
|
Does Sheet1 exist in the file?
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
i am getting the following problem when connecting to oracle using OracleClient in C# ASP.NET 1.1:
ORA-12505: TNS:listener could not resolve SID given in connect descriptor
I am using this in connection stirng with proper user and password:
Data Source=ABC;User ID={0};Password={1};Unicode=true
where ABC is the Database added in Management Console (only client is installed on the computer), i can connect to this database using Console and also by creating dsn. Can anyone figure out the problem, as my program is running on many other pcs correctly.
-- modified at 7:06 Tuesday 10th July, 2007
Regards
Shajeel
|
|
|
|
|
|
Problem is that my application is running on dozens of other boxes, so it is not the problem in which i want to change my code. This is some sort of configuration problem which i am not able to resolve.
Regards
Shajeel
|
|
|
|
|
Hi
I am using asp.net 2003(vb code behind). I hve given the connection in web.config like this
<add key="test" value="Provider=SQLOLEDB.1;Password=mypwd;Persist Security Info=True;User ID=myuid;Initial Catalog=Test;Data Source=myserver">
when i changed the data source to another server this is working properly in a lan network
i hve uploaded my project to a site for eg. if i give like www.mysite.com/login.aspx then if i enter the user id and password wht i want is i hve to access the local systems sql database( i want to get data from the database test whose connection i give above). But this is showing error as object reference not set. What should i do now to
Any body pls help me to resolve this problem.do i give any other thing in the connection string
Thanks in advance
with regards
anitha
|
|
|
|
|
micydon wrote: showing error as object reference not set
Set the object reference using New might be a start...
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Hi all,
I am new to SQL user defined function, I wrote an function on my own, I creates this function to get the count of total records available in an speciifed country, it works well, but where is no record in a specified country, it returs NULL and row count as 1. The function which i written is as below
CREATE FUNCTION [dbo].[cnt_country] (@country varchar(12))
RETURNS varchar(5) AS
BEGIN
declare @row_count varchar(5)
select @row_count=[country_code] from [dbo].[countrywise_users]
where [country_code]=@country
return @row_count
END
Actually i need to get the total row's available based on a country. If there is no records for an country , it should return null. Plz any one help me...
Thanks in advance
Know is Drop, Unknown is Ocean
|
|
|
|
|
Exelioindia wrote: If there is no records for an country , it should return null.
Did you mean: it should return 0?
In that case you can use:
return IsNull(@row_count, 0)
Wout Louwers
|
|
|
|
|
Hi
thanks a lot. I need this only. Thank you very much
Know is Drop, Unknown is Ocean
|
|
|
|
|
you can use the count function too!
select @row_count = count([country_code]) from.....
Gautham
|
|
|
|