|
This will do it.
DECLARE @MonthInt int
DECLARE @YearInt int
DECLARE @TempVarChar varchar(30)
DECLARE @Mth_Start datetime
DECLARE @Mth_End datetime
DECLARE @DaysInMonth int
SET @MonthInt = 08
SET @YearInt = 2005
-- GET START NEXT MONTH START IN Char
Set @TempVarChar = '01/' + CAST(@MonthInt As Varchar(2) ) + '/' + CAST(@YearInt As Varchar(4) )
-- Convert to Date
Set @Mth_Start = (Convert( datetime, @TempVarChar, 103 ))
-- Go Back one day to get last day in Month.
Set @Mth_End = DATEADD( dd, -1, @Mth_Start)
-- Get total days in Month
SET @DaysInMonth = DATEPART(dd, @Mth_end)
SELECT @DaysInMonth
|
|
|
|
|
I'm trying to connect to Exchange 2003 and gain access to Appointment information. I have seen a few articles about doing this in webDev, or something like that, but know nothing about how it works. I am coding in C#. I tried Microsofts website, under their Exchange Developer section but couldnt't find any actual code camples. Is there a nice simple wasy way of connecting to Exchange and extracting information and I just haven't been able to find it, preferably using ADO.NET and by easy hopefully like connecting to a sql or OleDB connection.
--Peter
|
|
|
|
|
Hello
I've install MSDE and my soft don't run !
I think it's because anything listen at the port 1433
When i write "netstat -na" in the command window , any port 1433 !
How can i open this port ?
thank you
SeLoRBIS
|
|
|
|
|
hi there,
sorry if I misunderstood ur mean.
u mean that MSDE cannot run because the port 1433 is already occupied by another process, right?
SeLoRBIS wrote:
How can i open this port ?
if so, u cannot open this port because it's alredy openned.
so the only way in this case is that u need to find out which program/process is using this port. Then stop it and install MSDE
Gud luke
<< >>
|
|
|
|
|
The port 1433 is the port use by MSDE or MS SQL Server !
But he's not use by another application .
He's not use , that all .
And i want that MSDE use it!
When i write "netstat -na" in console windows I see he's not heard by anything !
He's Closed .
It's the reason , my application don't communicate with the database MSDE
Thank You !
SeLoRBIS
|
|
|
|
|
if the port 1433 is already bound by a process, this can not be used anymore ...
so if u want to use it in MSDE u must to make sure that it's not being used by any process before installing MSDE
<< >>
|
|
|
|
|
I say to you that the port 1433 is not use by any process : it's the problem !
SeLoRBIS
|
|
|
|
|
Gud luke to u
<< >>
|
|
|
|
|
Yes ok ! i think i'll find better by my self lol
SeLoRBIS
|
|
|
|
|
I've configured several COM components to support transactions, and they are called by my C# serviced component, which is configured to require a new transaction.
However my component fails on the first COM call, with an error saying that the new transaction could not enlist in the specified transaction coordinator. Is this a cross machine problem, and if so, would having all components and databases running on one machine under one coordinator solve it?
I'm new to this, any help would be appreciated.
The DJ's took pills to stay awakwe and play for seven days. - Jim Morrison, Black Polished Chrome.
|
|
|
|
|
Having the components all on one server isn't the issue. COM+ allows for cross machine transactions, look elsewhere for the solution.
|
|
|
|
|
|
hi there,
manije wrote:
get id from a table
=> using ExecueScalar to get id from DB. then convert and assign it to a variable
manije wrote:
I want to display(id) in a messagebox
=> convert ur variable to string and display this in a msgbox
<< >>
|
|
|
|
|
|
thanks for your reply !
I'm a beginner in C# .
Can you write the code please !
Remember
my variable is GetId[int] and my table has 3 fields ,id[int],name[nvarchar],fname[nvarchar] and I want to put the id (from the table ) into the variable (GetID). THANKS!
mostafa hosseiny b.
-- modified at 7:43 Wednesday 7th September, 2005
|
|
|
|
|
manije wrote:
I'm a beginner in C# .
Can you write the code please !
It doesn't matter that you are a beginner, you have to think through the problem for yourself otherwise you will learn nothing. I have already seen that you ignored my advice - there could be a valid reason for this, but I don't know what that it. From my point of view I am just being ignored and for the money* I'm getting for providing this service it really isn't worth it.
Hint: I don't get paid for this. I volunteer my own time and my own equipment to try and help - but you have to show that you are willing to learn and not just copy and paste code snippets
My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
Derar Colin Angus Mackay !
Certainy I accept your Advice , and in this way , it's need to me to try do best ... . Learn,Understand of the concept ... ,
in any case I have to study and ask to every one can help me !
by the way , finally and after a day , I write this to reply my app.
int mygetid=Convert.ToInt32(mytable.Rows[0][0]);<br />
MessageBox.Show(this.mygetid.ToString());
---------------------
in any case , thanks in advance again for your patient
mostafa hosseiny b.
-- modified at 3:19 Thursday 8th September, 2005
|
|
|
|
|
we're very happy to help u
but sometimes I cannot remember exactly funcs/statements to give u an perfect example code
Happy programming
<< >>
|
|
|
|
|
also , we're very very happy , if every one advice me , because we learn atleast.
Also and also we're looking for your Help !
Thanks ! and Happy day!
mostafa hosseiny b.
|
|
|
|
|
I am trying to bind the data to Datagrid in ASP.NET web application. My database “AddressBook” is created in MS Access 2000.
I used ‘OleDBConnection’ control and set ‘ConnectionString’ property referring to my MS Access database.
I have written following code in the ‘Page_Load’ method,
private void Page_Load(object sender, System.EventArgs e)
{
OleDbCommand oleCommand = new OleDbCommand();
oleCommand.CommandText="Select * from ADDRESSDATA";
oleDbConnection1.Open();
oleCommand.Connection=oleDbConnection1;
OleDbDataReader oleDataReader = oleCommand.ExecuteReader();
DataGrid1.DataSource=oleDataReader;
DataGrid1.DataBind();
oleDbConnection1.Close();
}
Code compiles successfully, but it following error during execution:
“The Microsoft Jet database engine cannot open the file 'C:\Manisha\Address MS Access Data\AddressBook.mdb'. It is already opened exclusively by another user, or you need permission to view its data.”
Ms Access Database I am using is not open and no other application uses that database.
What’s wrong in this application. Can anyone suggest something please?
Thanks
|
|
|
|
|
one thing, u have to grant permission of asp.net account to AddressBook.mdb
<< >>
|
|
|
|
|
thanks for reply...but how should i do this? is there any specific property to set? pls let me know
|
|
|
|
|
now I cannot remember excactly what steps need to do.
but u can try as:
- right-click on the folder that contains the .mdb file
- In Security tab, add asp.net account and remeber to add Write permission for asp.net account
Hope this helps
<< >>
|
|
|
|
|
hello, thanks for reply, but it is not clear to me how to progress, what do you mean by ASP.NET account? whaere i hv to specify it? I would be glad if ui let me know more deails?
|
|
|
|
|
hi there,
default, ASP.NET account is created when installing asp.net. u can see this by browsing to computer managerment >> Local Users and Groups
this account has limited rights, so u have to grant permission for this account to access ur DB file
<< >>
|
|
|
|