|
So when you copied the code , it changed on fly it to close(). : why do you have two connection string ? why dont you trap for exception ? i dont know how you going to debug your code its complicated
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
I dont' have much idea about exceptions but code is not complex 1st part is just checking wether the friend request in db is approved or not and selecting the unapproved ones and then it's calculating that how many days old the friend req is if more than 10 then delete that request from database this is what i want but deleting part not work..
|
|
|
|
|
That should have been done only in SQL not in C# , in C# you should have just called the SP and Pass the Parameters.
please this time make sure the connection does not change onfly . Recopy the code and comment it by telling me what you want to do and i will give you a better way on how to do it
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
The code is same. I just want to select those friend request which have exceed'd limit of 10days and delete them. I saved the username who loggd in in a connection string "uname"..and retriving dates from db (coloumn name date1) and confirm is the db coloumn in which if no means friend request not accepted. In select command im retriving dates and compairing with current date if exceeds by 10 then delete that particular request from db..
|
|
|
|
|
I tried to rework your code and in got more confused than you , now tell me is there any particular reason why you use a datareader ? again your delete statment is incorrect.
change
"Delete from friends where Username
to
"Delete friends where Username
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Well datareader i used for select statement..and i'll try what u said "delete friends where username" instead of "delete from"..but right now im away from my system..there is one more way i was thinking 2 do..store those dates which hasto be deleted in array and close datareader connection..and then again open new connection for delete..but i want to implement it with two queries..
|
|
|
|
|
The Problem with your reader is holding on to the Connection. i suggest you use a datatable. atleast your code will be a little bit clearer because there wont be any looping happening. as i stated before what youdo can be done in one sql SP
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
I guess im getting what u trying to explain my datareader is holding up connection not passing it to other connection string..by the way what is sql sp please explain lil'..thnx
|
|
|
|
|
The SP i meant a Stored Procedure, i feel you could have done all this in a Stored Procedure than trying to manupilate the table in C#.
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Stored procedure means storing data somewhr like array or datasets..? And how to use sp in ms access(sql doesnt work in ma system)..i wanna talk 2u online on IM..some direct queries i wanna solve plz if u dnt mind..
|
|
|
|
|
NO that is not a stored procedure. Make it fast because i have to go home. am on google talk and Skype with vuyiswamb
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Mine is blastome on gmail and dorian_yates@yahoo.co.in..thnx but rite now im outtie home nt on system..i'll talk 2u later on IM..thnx 4 help..
|
|
|
|
|
Cool
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Well i've added u on gmail..vuyiswamb@gmail.com..
|
|
|
|
|
i have design a form and i want to insert a photograph in the form and send to databases
|
|
|
|
|
Hi Shukla,
Please find the follwoing article [^]which is perfect for your query I gues. I am assuming you are working on ASP.NET.
Let me know if you need any further help.
|
|
|
|
|
You really gona have to start using google before you post
Save An Image Into SQL Server 2000 Database[^]
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Not only do expect someone to do the research for you, but you also expect us to not notice you posting this request again.
only two letters away from being an asset
|
|
|
|
|
rj shukla wrote: i have design a form and i want to insert a photograph in the form and send to databases
Deleting old message and repost the same question again does not help you to get the answer.
|
|
|
|
|
Hi,
How to change the visiblity of a frame from a page in another frame?
Thankyou
Yesuprakash
|
|
|
|
|
Hi,
I have the following FilteredTextBoxExtender on a textbox.
<cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server" TargetControlID="txt_VisitorName" ValidChars=" " FilterType="Custom,UppercaseLetters, LowercaseLetters"
Enabled="True">
</cc1:FilteredTextBoxExtender>
when i select a row in the list view it will fill load data to the textboxes the FilteredTextBoxExtender is clearing the spaces in the textbox,i specified space as the valid character, but its not firing
can any body help me regarding this.
Thanks&Regards
DEEP
hi
|
|
|
|
|
Hi,
I am in the early stages of designing/developing an ASP.NET 3.5 web application with an SQL Server 2008 database. The following is the way i am thinking of approaching the design for this particular area but i am keen to know any cleverer, more efficent ways of doing this:
My application will contain a number of user accounts. Each user will have a field associated with it in the database called "League". The "League" database field will contain a limited but indefinite number of unique identifers for each league the user is in. Each unique identifier in the league column will be seperated by the character ; which will allow me to parse through and obtain each users leagues as needed
Once again i dont think this is the best approach to this and i would be keen for anyone with any suggestions which utilize any .Net technology in a clever and efficent way.
I really appreciate any tips and suggestions that anybody may have!
Thank you
Regards,
Jon
|
|
|
|
|
It is not a good approach. Create another table and store the league details for each user. That is, this table will have a row for each league pertaining to a user. user id will be the foreign key for user and league tables.
|
|
|
|
|
|
Yes.. I do agree with dotnet buddy. This is not any typical ASP.NET issue. This is mainly I think a database design related issue. Per your details, it means you have users who are associated with different leagues. Each league is identified by an identifier. It's a one-to-many relationship.
So you should be having two tables - User and UserLeague. Both of them should be linked with UserId which is a primary key in User table and a foreign key in UserLeague table. In the UserLeague table you can have LeagueId column (your identifier for League). So you can have multiple rows for same userId in UserLeague table.
Let me know if this helps or not.
|
|
|
|