|
A few points.
1. It's very, very rude to state that it's urgent. It is up to us to decide if and when we want to reply.
2. You could have tested this yourself with a minimum of effort. Why didn't you? Don't expect others to do your thinking for you - you should actually try and solve problems for yourself.
3. Putting your email address in a post is just asking to be spammed.
|
|
|
|
|
I m sorry for that,actually i am new to codeproject so i dont have much awareness regarding the rules and regulation.
In future,I will take care of the things.
anyways thanks for replying...
|
|
|
|
|
Fair enough. Since you are new to the boards, this[^] article might help you get to know the niceties of posting on Code Project.
|
|
|
|
|
HI,
In my database i am storing the date of birth of each user, but how can i create a query which give date of births of all user whose birthday month
falls in the current month.
that means if current month is march then the query should fetch the records of all users which are born in march.
|
|
|
|
|
Suppose
create table TestBirth
(
UserId int identity(1,1)
,UserName varchar(50)
,birthday datetime
)
is the table which contains the records
UserId UserName birthday
1 Manoj Singh 2008-02-02 00:00:00.000
2 Manoj singh2 1894-07-03 00:00:00.000
4 Anshu singh 1894-07-04 00:00:00.000
5 Garima singh 1894-07-13 00:00:00.000
6 Rajan singh 1894-07-14 00:00:00.000
7 Garima chaudhary 1894-07-03 00:00:00.000
8 Pankaj chaudhary 2008-03-03 00:00:00.000
Below query will help you
Select UserName from testbirth where Month(birthday) = month(getdate())
Sarvesh Upadhyay
Senior Software Engineer
Birlasoft India Ltd.
Microsoft Certified Professional Developer in Dotnet 2.0 Enterprise Application
|
|
|
|
|
SELECT * from tablename where (@Month = month(Date) and @year = year(Date))
try this and give me feedback
Ahmed hassan
|
|
|
|
|
Hi
I have 2 tables:
1. Physicians, consisting on two columns:
primery_specialty_id, sub_specialty_id
2. Specialties, consisting on two columns:
specialty_id (primary key and the foreign key for both Physicians table columns above), specialty_name
Physicians.primery_specialty_id is nn but sub_specialty_id can be null and in my db there are a lot of physicians that have 1 specialty but not a second.
I want to create a view that will retrieve all data showing the specialty_name1 for all primery_specialty_id and specialty_name2 for all sub_specialty_id.
I try to create another view that will hold the specialty_name for the sub_specialty but I don’t know how can I show all data containing the sub_specialty which is null.
if anyone can help me on this it will be more than appreciated
Thanks
Yohay
|
|
|
|
|
I am using SQL Server EXPRESS Edition for my C# client. I have written an SP InsertData for inserting data into a table. Another SP GETDATA fetch all the data from the table.
Now the problem is with my C# client application. On the main Form I have placed a grid which is filled by calling GETDATA stored procedure. There are text fields and an ADD button on the main form. When I click add button I call InsertData SP and then in the same event handler I call GETDATA SP again to refresh my grid. It works well and show data in grid but later when I check the database no entry is inserted in the database. Again I run the application and database is in the previous state (i.e. no data is found that was inserted in the previous run). In other words data is shown to be inserted but is not actually inserted in the database.
What could be the problem?
For refernce I have checked msdn where someone has posted the same problem here. http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2888935&SiteID=1[^]
but no satisfactory answer found up till now.
Mujtaba
"If both of us are having one apple each and we exchange it, at the end we both will have one apple each. BUT if both of us are having one idea each and we exchange it, at the end both of us will be having two ideas each."
|
|
|
|
|
Have you tried to run InserData via query analyzer ? Put break points and step into the code.
|
|
|
|
|
Yes I have tried the procedure in query analyser and it inserts data successfully. I have added 4 records in tabale using this SP but and everytime I start application, it starts from ID = 5 (ID is IDENTITY column).
Mujtaba
"If both of us are having one apple each and we exchange it, at the end we both will have one apple each. BUT if both of us are having one idea each and we exchange it, at the end both of us will be having two ideas each."
|
|
|
|
|
Just a lil doubt, are you explicitly opening transactions?
If yes, you'll have to commit your transactions by using the COMMIT keyword everytime you insert a row. By default AUTO COMMIT is ON in SQL Server. Check your connection properties to see if its turned off somewhere.
SG
Cause is effect concealed. Effect is cause revealed.
modified on Monday, March 24, 2008 5:39 AM
|
|
|
|
|
No I am not using this statment and I have also checked SqlCommand object's propertys using it like this com.Transaction.Commit(); function but it is not working.
I think it is the problem of SQLEXPRESS that may does not allow inserting or updating by default. If anyone give any idea about it, I shall be thankful.
Mujtaba
"If both of us are having one apple each and we exchange it, at the end we both will have one apple each. BUT if both of us are having one idea each and we exchange it, at the end both of us will be having two ideas each."
|
|
|
|
|
Check your connection string/properties. Are you connecting to SQL Express as 'User Instance = True' ?
I don't speak Idiot - please talk slowly and clearly
|
|
|
|
|
Yes this property is set to true as 'User Instance = True'.
I think it might be some limitation of SQL EXpress but uptil now I haven't come to know about any such limitation.
Same problem also posted here by someone.
http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=2555908&SiteID=17[^]
Mujtaba
"If both of us are having one apple each and we exchange it, at the end we both will have one apple each. BUT if both of us are having one idea each and we exchange it, at the end both of us will be having two ideas each."
|
|
|
|
|
Make sure your connections string says something like:
Database='Path&FileName';...;User Instance = False
I don't speak Idiot - please talk slowly and clearly
|
|
|
|
|
Well everything is fine with connection string and application works fine enough as far as it is in RAM but acutal changes are not commited.
Mujtaba
"If both of us are having one apple each and we exchange it, at the end we both will have one apple each. BUT if both of us are having one idea each and we exchange it, at the end both of us will be having two ideas each."
|
|
|
|
|
Oh dear. This old chestnut again. I assume that you are running SQL Server Express as part of your application and that you have a local database. Here's a hint - when the application runs, the database is copied into the bin directory (everytime it's run from the Visual Studio menu). This means that the work you've inserted effectively disappears because it has been replaced by a new copy of the database. In order to see the data, you need to look in the Debug (or Release depending on your build mechanism) directory where you will be able to see the database. You can open it up and take a look at it in there.
|
|
|
|
|
Thank u very mcuh Henlon.
That was AWESOME. [ ]
That really works. When I opened the database from bin folder it contained all the data that was inserted earlier.
I don't know how should I say thank u to u. Thank u so much. [;)]
Mujtaba
"If both of us are having one apple each and we exchange it, at the end we both will have one apple each. BUT if both of us are having one idea each and we exchange it, at the end both of us will be having two ideas each."
|
|
|
|
|
No problem. I'm glad I could help.
|
|
|
|
|
Hi All,
I've just downloaded and installed this ready to integrate into a desktop app i'm making. I've just going through an article on SQLServerCentral to get a quick introduction to it. The weird thing is that when adding the reference to System.Data.SqlServerCe.dll it wasn't in my list on the .NET tab ... I checked the GAC and the file is in there though!
Also "Microsoft SQL Server Compact 3.5 " isn't appearing in my list of available DataSources inside Visual Studio 2008.
I'm just downloading SQL Server Management Studio Express to see what light that can shed on this. Any pointers or info would be great.
Cheers,
Jammer
Going where everyone here has gone before!
My Blog
|
|
|
|
|
Hi all,
First let me discuss the scenario. I have 2 tables,a party master table where in i store all details of party(a user) which has a PK partycode and a price_relation_master table where i associate that party with multiple items ie an itemcode.The items come from a table called item_master with pk itemcode where all the details of an item are stored.
Now i wan`t to develop a copy facility such that all the items assigned to a party are copied to other party. Copying is not a prob, but i before copying i have to check whether that item was previously assigned to dest party or not. If the item was assigned to that party that item shouldn`t be copied. Does any body have any info about such cases!!!! Any help would be appreciable....
When you fail to plan, you are planning to fail.
|
|
|
|
|
How to pass the parameters of @dbName, @LogicalName, @ToServer
to job dynamically using stored procedure?
|
|
|
|
|
I am having trouble figuring how to structure the tables to solve this problem. Here's where i'm at:
Existing Tables:
Tool(
ToolID Int Id PK...,
...,
Cavities Int Not Null
)
Product(
ProdID Int Id PK...,
...
)
ProdLine(
PLine ID Int Id PK...,
...
)
Problem:
A Production 'Cycle' consists on making a combination of 1 to n Products with a specific Tool where n <= Cavities for that Tool.
For example, a tool can make up to n peices of 1 product per cycle, or 1 peice of 4 products per cycle, or a combination thereof.
A common combination would be for two products to be made with a given tool on a given ProdLine in a given amount of time.
I want to create table(s) to reflect the relationships between this additional data(CycleTime, and Product Combinations for a Tool) and the existing tables.
hope this is decipherable, it is spinning my head.
Is have modelled several solutions that are all very ugly and I wonder if anyone has an elegant suggestion (...my wife has given me many (non-elegant) suggestions mostly regarding why i am trying to learn this concept on Easter Friday night! )
|
|
|
|
|
Hi,
How to Debug stored porcedure SQL server 2000 ?
Thank& Regards
Vijay s
|
|
|
|
|
Hi Vijay,
If you are looking to debug a stored procedure within SQL Server 2000 then I would like to mention that it consits several steps which is hard to explain here. Thefore, I would suggest you go through the following article which explains debugging process (within SQL Server 2000) step by step.
http://www.15seconds.com/issue/050106.htm[^]
I hope this helps.
Regards,
John Adams
ComponentOne LLC
|
|
|
|