15,867,330 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Mario Majčica (Top 187 by date)
Mario Majčica
29-Jan-13 5:10am
View
Sorry mate, it was a joke. Your question is just impossible to answer. Cheers
Mario Majčica
22-Jan-13 5:00am
View
Based on your edit, check mine. Cheers
Mario Majčica
22-Jan-13 4:22am
View
Can you make an example of the items in collection A and items in collection B together with the result you are expecting? It is not clear by your code. Then we can study a correct LINQ statement that will do. Cheers
Mario Majčica
26-Nov-12 3:09am
View
What is the reference that joins two tables? Location == CityId?
Mario Majčica
29-Oct-12 6:24am
View
What have you tried till now? In order to help, you should share at least the ASPX definition of interested code.
Mario Majčica
17-Oct-12 4:17am
View
Well I just saw it. You got my 5 ;) (still you were not precise on answering why :P )
Mario Majčica
17-Oct-12 4:12am
View
You are welcome.
Mario Majčica
17-Oct-12 4:11am
View
Seems that my answer, answers to all of his questions :)
Mario Majčica
16-Oct-12 7:41am
View
Good luck ;) !
Mario Majčica
16-Oct-12 7:33am
View
If he is so sure, let him show you how to do it. You are not obliged to know. You tried and it is not working. Ask him, what now?
Cheers
Mario Majčica
16-Oct-12 7:24am
View
As I managed to read on web, ClickOnce is for windows app deployment only and you cant deploy a web application with it. Check this, http://social.msdn.microsoft.com/Forums/en/winformssetup/thread/b06ba9a1-db0c-4a60-814e-d2f884d85e8f
Cheers
Mario Majčica
16-Oct-12 7:22am
View
Deleted
Not sure, check this http://stackoverflow.com/questions/3408254/c-sharp-deploying-my-application-clickonce-from-web-only
Mario Majčica
16-Oct-12 7:11am
View
First you should show us what did you tried till now. We can't guess the code you wrote.
Mario Majčica
16-Oct-12 7:05am
View
It is a quite unusual requirement, still I found this, check it. http://www.c-sharpcorner.com/UploadFile/shrijeetnair/StepbyStepSetup11102005033122AM/StepbyStepSetup.aspx
Mario Majčica
16-Oct-12 7:01am
View
Basically you would like to create a setup.exe that will deploy your web app on that machine?
Mario Majčica
12-Oct-12 9:40am
View
What is precisely your problem? Are you trying to achieve this on WinForms, WebForms, or...???
Mario Majčica
9-Oct-12 3:29am
View
Can you be more specific?
Mario Majčica
2-Oct-12 4:33am
View
What did you tried till now? With what part of the code do you have problem?
Mario Majčica
19-Sep-12 8:56am
View
What is basically your question???
Mario Majčica
19-Sep-12 5:31am
View
If the answer was useful, don't forget to accept or/and vote it. Thanks
Mario Majčica
19-Sep-12 5:15am
View
Try it and let us know. Good luck!
Mario Majčica
19-Sep-12 4:50am
View
Unfortunately you are limited to the assembly. You may think of merging assemblies into one, but I'm not completely sure that it will work. Check this:
http://research.microsoft.com/en-us/people/mbarnett/ILMerge.aspx
Mario Majčica
19-Sep-12 4:28am
View
As I told you, it is a bad idea to have all this data inputed in a single box. Use multiple textboxes and perform the validation on them.
Mario Majčica
18-Sep-12 8:46am
View
So you are trying to create tables in database and then use them in your code? Here Entity Framework comes in handy. Check this video: http://msdn.microsoft.com/en-us/data/gg702906
and
http://msdn.microsoft.com/en-us/data/cc546554
On this page you will find many interesting videos:
http://msdn.microsoft.com/en-us/data/videos.aspx
Cheers
Mario Majčica
18-Sep-12 7:55am
View
You need to be more explicit. What kind of table you are trying to create? What for? Where?
Mario Majčica
18-Sep-12 7:54am
View
No but you can put your table in a panel and make no borderless table.
Mario Majčica
18-Sep-12 5:09am
View
Try with this:
this.Location = new Point(scr.WorkingArea.Right - this.Width, (scr.WorkingArea.Bottom - this.Height) / 2);
And don't forget to accept and vote the answer ;)
Cheers
Mario Majčica
18-Sep-12 4:44am
View
You had just asked that: "it is better if i will get middle ---right". Can you explain exactly where and how you would like to put this form on the screen??? Make a picture and post the link! :)
Cheers
Mario Majčica
18-Sep-12 4:31am
View
Then modify the location in this way:
this.Location = new Point(scr.WorkingArea.Right / 2, scr.WorkingArea.Top);
It is a simple calculation, WorkingArea gives you the screen positions, and with that you can calculate the point where you want to show your form.
Cheers
Mario Majčica
18-Sep-12 4:24am
View
Sorry, check the edit, my copy paste error. I tried the code above and it is working properly.
Cheers
Mario Majčica
15-Sep-12 5:50am
View
You're welcome. Let me know if it worked and if so, accept and vote the answer. Cheers
Mario Majčica
14-Sep-12 15:02pm
View
Also check this:
http://msdn.microsoft.com/en-us/library/ms178472.aspx
Note: PreRenderComplete
Raised after each data bound control whose DataSourceID property is set calls its DataBind method. For more information, see Data Binding Events for Data-Bound Controls later in this topic. This event the is raised after the PreRender, so...
Mario Majčica
14-Sep-12 14:49pm
View
Then you can't disable anything. The items are yet not there. Try by defining the Data Bound event and disable it in the same way:
protected void rblTeam_DataBound(object sender, EventArgs e)
{
ListItem srtItem = rblTeam.Items.FindByValue("SRT");
if (srtItem != null)
srtItem.Enabled = false;
}
Cheers
Mario Majčica
14-Sep-12 3:17am
View
OK, tmpItem was null, but what was the count of rblTeam.Items?
Mario Majčica
13-Sep-12 6:20am
View
You will need to load them and transform them before the control starts.
How about writing an http handler that will serve this images?
This article may be helpful http://www.aspsnippets.com/Articles/Display-Images-from-SQL-Server-Database-using-ASP.Net.aspx
and
http://www.dotnetcurry.com/ShowArticle.aspx?ID=129
Mario Majčica
13-Sep-12 3:42am
View
In which part of code did you tried to find the item? Can you set a break point on FindByValue and see if the control contains items?
Mario Majčica
10-Sep-12 6:23am
View
First rows than cells!
And sorry why are you trying to add a cell in a cell???
Mario Majčica
10-Sep-12 6:18am
View
A performance and readability disaster! :)
Mario Majčica
10-Sep-12 5:50am
View
What did you tried till now?
Mario Majčica
7-Sep-12 11:12am
View
are you sure about that? In an ASP.NET project?!?!?
Mario Majčica
6-Sep-12 6:02am
View
Glad to here that. Vote up the answer if it was helpful!
Cheers
Mario Majčica
6-Sep-12 5:51am
View
Also my example contains spaces because of formatting. If you get out of the declared string all the spaces, they will not be visible in the example. Try it by setting the text in the multiline textbox and then process it. It should work. Inform yourself about '@' string literal.
Cheers
Mario Majčica
6-Sep-12 5:47am
View
If you are trying to remove the unused spaces, use the Trim function:
s.AppendFormat("{0}. {1}{2}", i + 1, lines[i].Trim(), Environment.NewLine);
You can also use TrimStart or TrimEnd in order to remove only initial or endin spaces.
Mario Majčica
6-Sep-12 3:53am
View
Sorry but with these information only I can't do much.
Mario Majčica
6-Sep-12 3:48am
View
Did you registered your dll correctly? I'm not sure how to do it in C++, but here is the link for starting understanding shellex and a working .NET 4.0 project (as for the managed code dll, it can be done only with FW4.0 and beyond) http://geekswithblogs.net/Jialiang/archive/2010/09/16/writing-windows-shell-extension-with-.net-4---part-1.aspx
Cheers
Mario Majčica
4-Sep-12 3:41am
View
What do you mean show the file? Show the content of the file or show the file name or what???
Mario Majčica
31-Aug-12 7:09am
View
please show your table here
Mario Majčica
29-Aug-12 8:55am
View
What you are asking is to find recursively all the controls in the page. Try this
public static List<Control> GetAllControls(ControlCollection ctrls)
{
List<Control> RetCtrls = new List<Control>();
foreach (Control ctl in ctrls)
{
if (ctl is TextBox)
{
RetCtrls.Add(ctl);
}
else
{
RetCtrls.AddRange(GetAllControls(ctl.Controls));
}
}
return RetCtrls;
}
Mario Majčica
29-Aug-12 8:49am
View
The code I proposed will do the job. If you need to restore the values, you can do the opposite process. However this is not an elegant solution for solving a problems of this type.
Cheers
Mario Majčica
29-Aug-12 4:22am
View
I will not sum in the code. More efficient will be to let SQL Server do the sums via the query you are executing.
Mario Majčica
23-Aug-12 5:16am
View
I just updated the solution. Converting code is easy http://converter.telerik.com/ or http://www.developerfusion.com/tools/convert/csharp-to-vb/ .
Cheers
Mario Majčica
23-Aug-12 4:58am
View
Can you show us how the grid is defined in aspx file?
Mario Majčica
22-Aug-12 8:52am
View
We do not have a magic ball, how can we help you if you do not supply any code or example? Should we try to guess how your code is working? Or you do not know how to create a string from multiple strings???
Mario Majčica
21-Aug-12 4:09am
View
Are you sure that the condition is met? If you set a break point on smtpClient.Send(message); does it hit?
Mario Majčica
20-Aug-12 9:06am
View
You sad that you are trying to redirect to a page on a different server. The context is applied on IIS instance of your app.
Mario Majčica
20-Aug-12 8:27am
View
Why wouldn't you use session or QueryString?
Mario Majčica
8-Aug-12 3:50am
View
Well, each time you create a controls dynamically, on postback you need to recreate them, otherwise the viewstate can't be unpacked and you can't get what happened on client side. Once this is done and you got the right action, then you can change the properties and resend the page to the client again.
Mario Majčica
18-Jul-12 8:13am
View
Make an example. Your question is not clear. What kind of merge are you trying to do?
Mario Majčica
10-Jul-12 6:02am
View
What's your goal? What kind of authentication you are trying to implement?
Mario Majčica
6-Jul-12 7:00am
View
Are you using ASP.NET or WinForms?
Mario Majčica
29-Jun-12 4:09am
View
Than please close this question by marking an answer as a solution.
Good luck!
Mario Majčica
29-Jun-12 4:04am
View
Sorry but there was nowhere saying that this is a WinForms project. Please tag your questions correctly and try to be more precise on it.
On Devexpress site you will find many examples about everything and they have a great support team, try making a question on their site.
Cheers!
Mario Majčica
28-Jun-12 6:47am
View
Graag gedaan! Anytime ;)
Mario Majčica
28-Jun-12 6:10am
View
Well it will be a shame redoing what Ivar Lumi did. Try with this lib http://www.codeproject.com/Articles/16030/NET-vCard-API-for-creating-and-parsing-vCards
Also you have an example project attached on how to use it. It is in C# but converting it to VB should not be a problem (if you really need it converted) http://www.developerfusion.com/tools/convert/csharp-to-vb/.
If you want to contact me in private, check this http://blog.majcica.com/contact/
Mario Majčica
28-Jun-12 4:50am
View
Dude, you are right. My 5 ;)
Mario Majčica
28-Jun-12 4:32am
View
This is not even compiling:
Msg 242, Level 16, State 3, Line 2
The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.
Mario Majčica
28-Jun-12 4:29am
View
Try the last edit, it turns 4!
Mario Majčica
28-Jun-12 3:50am
View
Where the code stops? At which point?
Mario Majčica
19-Jun-12 8:02am
View
Please share the full SP you wrote, with parameters, etc. otherwise is very hard to help you. And please edit the question, formatting correctly the code parts.
Mario Majčica
13-Jun-12 4:47am
View
Is there a postback performed by the combobox?
Mario Majčica
1-Jun-12 3:45am
View
What is the problem with the current code? When managing Enter Key do not forget to prevent the default event and cancel bubble.
Mario Majčica
15-May-12 8:07am
View
Also this can be helpful
http://www.codeproject.com/Articles/16231/Deploy-your-Application-and-Database
Mario Majčica
15-May-12 8:06am
View
You will need to installa manually SQL Serve, but the DB you can still deploy it via installer. Check this out:
http://www.codeproject.com/Articles/10032/Deploy-SQL-Server-databases-easily-with-an-Install
Mario Majčica
15-May-12 7:52am
View
Download the express version of it and enjoy:
http://www.microsoft.com/en-us/download/details.aspx?id=1695
Mario Majčica
15-May-12 7:42am
View
Try to be more precise. Are you speaking about MS SQL, what are your limitations and your needs?
Cheers
Mario Majčica
15-May-12 7:32am
View
Beside, there are many ways of executing a query, these are some of them:
http://sourceforge.net/projects/queryexplus/
http://toadworld.com/SQLSERVER/tabid/760/Default.aspx
http://versabanq.com/products/squel.php
http://msdn.microsoft.com/en-us/library/ms162773.aspx
etc.
Why should you not use SSMS??? There is an free version of it.
Cheers
Mario Majčica
15-May-12 7:28am
View
In you application I suppose, you didn't wrote down anything about your problem more in detail.
Mario Majčica
15-May-12 7:28am
View
Deleted
In you application I suppose, you didn't wrote down anything about your problem more in detail.
Mario Majčica
14-May-12 3:43am
View
What is the question?
Mario Majčica
7-May-12 3:48am
View
Are this two tables structurally identical? Are you trying to merge the data between the two? What did you try till now? Make an example.
Mario Majčica
26-Apr-12 3:56am
View
It's a nice and neat idea but not the most efficient. However if performances are not an issue, it's a clean solution.
Cheers
Mario Majčica
26-Apr-12 3:52am
View
Glad to help. If helpful accept and eventually vote the answer. ;)
Cheers
Mario Majčica
25-Apr-12 4:51am
View
Try setting the timer1.Enabled = false;
Mario Majčica
11-Apr-12 5:40am
View
Try instead of Format(dp1.Value, "MM/dd/yyyy") just dp1.Value. Cheers
Mario Majčica
11-Apr-12 5:22am
View
And where do you say that in the question? Still you can use command parameters, just Google the keywords.
Check this out http://msdn.microsoft.com/en-us/library/bbw6zyha(v=vs.100).aspx
Cheers
Mario Majčica
11-Apr-12 3:32am
View
True. Also the best approach will be adding an alias on FQDM on domain DNS if possible.
Mario Majčica
11-Apr-12 3:30am
View
:)
Mario Majčica
11-Apr-12 3:28am
View
I updated the solution. Vote if willing ;)
Cheers
Mario Majčica
10-Apr-12 13:09pm
View
I'm via cell phone. However check this http://msdn.microsoft.com/en-us/library/8zha3xws(v=vs.71).aspx
Mario Majčica
4-Apr-12 9:20am
View
Why do you need to do that on SQL side? it will be easier to do it server side.
Mario Majčica
2-Apr-12 7:05am
View
Please show some code, otherwise is difficult to help you.
Mario Majčica
26-Mar-12 11:19am
View
You're welcome! Good luck!
Mario Majčica
26-Mar-12 10:49am
View
Well you can't convert it to a strongly typed dataset in this way. Try another approach, based on the table that you need to merge, create a new instance of strongly typed dataset and fill it with the data from IList, then merge the two DataSets. You are missing some base concepts, start learning on how typed DataSet's work and then you can approach other problems. You can start from here http://support.microsoft.com/kb/320714 .
Cheers
Mario Majčica
26-Mar-12 10:20am
View
Well this is the right code then! First convert your NHibernate IList object to DataTable. There should be an overload on Merge method http://msdn.microsoft.com/en-us/library/803bh6bc.aspx that accepts the DataTable as parameter. Be however sure that the table yoa are trying to merge has the same name as one contained into the DataSet (http://msdn.microsoft.com/en-us/library/w32ft3a8.aspx) and that both tables have the same structure, in other words both contain the same column's and same column types. Hope this helps.
Cheers
Mario Majčica
26-Mar-12 10:06am
View
I have no idea of which other DataTable you are speaking. A code sample? or a namespace where this DataTable is defined?
Mario Majčica
26-Mar-12 7:43am
View
You can get more info's here:
http://www.codeproject.com/Articles/261639/Extension-Methods-in-NET
http://www.abhisheksur.com/2011/02/get-reflected-use-typedescriptor.html
etc.
What are you specifically interested in?
Mario Majčica
26-Mar-12 7:30am
View
Well TypeDescriptor.GetProperties() method returns the collection of properties for a specified type (in this case type T (generic)) in form of a PropertyDescriptorCollection. Once we have all properties of your IList type, we will create a table and add a column for each property we retrieved earlier. Then we will recurese the data in the list and add a new row and respective data to the datatable. This is a generic extension method and can be used with any IList. Ex. DataTable t = a.ToDataTable<Purchase>(); where a is at ex. List<Purchase> a = new List<Purchase>();
Cheers
Mario Majčica
14-Mar-12 9:07am
View
Hi digimanus, why did you updated my answer? What was wrong in it?
Mario Majčica
1-Mar-12 3:47am
View
You should also first set DataSource and only then call the DataBind method. Is problem maybe there?
Mario Majčica
29-Feb-12 10:50am
View
You're welcome!
Mario Majčica
9-Feb-12 6:31am
View
LoL. But when? Based on which action the mail should be sent?
Mario Majčica
9-Feb-12 5:49am
View
What's the context? Did you tried contacting DevX support? They have awesome support team ;)
Cheers
Mario Majčica
9-Feb-12 5:45am
View
Based on which event?
Mario Majčica
3-Feb-12 4:43am
View
Can you show us the code you are using for storing data to the session?
Cheers
Mario Majčica
6-Jan-12 10:10am
View
<asp:Localize> element works nicely.
Thanks
Mario Majčica
30-Dec-11 5:55am
View
Did you tried TNT Post Service?
Mario Majčica
31-Oct-11 16:19pm
View
Hah down voting the question, a big example of decency! Obviously you are suffering the points complex.
Mario Majčica
31-Oct-11 16:08pm
View
Well I made a clear question, your answer was a 5 second copy and paste of first googled link, does it deserve more than a down vote? And who are you to judge me a indecent developer?
Mario Majčica
31-Oct-11 15:52pm
View
I've tried, how ever with no result. I saw also the link you posted and I will now try with <asp:Localize> element, that is new to me.
Thanks
Mario Majčica
31-Oct-11 15:51pm
View
Well I did read them before. I was asking about your experience and the best practices. I am not a newbie that posted about the first thing he got stuck on.
Mario Majčica
22-Oct-11 17:59pm
View
Sounds like we are again making a homework!
Mario Majčica
22-Oct-11 9:19am
View
Let us know if worked!
Cheers!
Mario Majčica
22-Oct-11 9:12am
View
Check the update.
Mario Majčica
21-Oct-11 12:00pm
View
My 5 for critical point!
Mario Majčica
20-Oct-11 3:31am
View
How did you did it? Did this helped?
Mario Majčica
19-Oct-11 17:22pm
View
What do you intend with "to run the"?
Msg of the validator should appear on the screen only when you try to commit the page (do a post back or other events, depending on validation control) and the validation rule is broken.
Mario Majčica
19-Oct-11 7:30am
View
If helpful accept the answer and eventually vote it! Cheers!
Mario Majčica
17-Oct-11 9:34am
View
If helped, accept the solution and vote up the answer. Bye
Mario Majčica
13-Oct-11 17:02pm
View
Well great to hear that!
You can check even this great book. It explains why of many approaches and different ways to approach the same problem.
http://www.amazon.com/Microsoft%C2%AE-NET-Architecting-Applications-Pro-Developer/dp/073562609X/ref=ntt_at_ep_dpt_1
To give more visibility to this answer, please upvote it!
Cheers!
Mario Majčica
13-Oct-11 9:28am
View
Check this out, maybe it helps ;)
http://en.wikipedia.org/wiki/Sarcastic
Mario Majčica
7-Oct-11 15:32pm
View
I just updated the Solution 1, after testing it, and it works like a charm! I do not understand what is your question.
Mario Majčica
6-Oct-11 5:07am
View
Can you post more details about the tables?
Mario Majčica
5-Oct-11 18:28pm
View
Well I was just a kid at the time of Turbo Pascal, and I was more into the Quick Basic at that time! I know I know, there was no internet at that time and that was only thing available! Imagine that in the city library they have neither one book about the programming!
Good retrospective, my 5! ;)
Mario Majčica
5-Oct-11 16:35pm
View
What's wrong with SQL server management studio?
Mario Majčica
5-Oct-11 16:32pm
View
You are right. But meanwhile I was trying to decipher the question, I posted a wrong link. Only now I see that I had a wrong link on clipboard, this one has nothing to do with this question! My bad! It had to do with another question on whom I answered earlier.
Mario Majčica
5-Oct-11 9:15am
View
Using Reflection is more pro! ;)
Mario Majčica
5-Oct-11 7:16am
View
Once you start the process, it is running. You can check the StartTime property to see since when the process is running. Be more precise. What are you trying to achieve?!?!
Mario Majčica
5-Oct-11 6:42am
View
Brother is one of the premier providers of products for the home, home office and office. More info on http://www.brother-usa.com/ !
What do you intend for process ready?
Mario Majčica
4-Oct-11 8:49am
View
I didn't tested it on MySQL, but MySQL was specified only after I posted the answer. On MS SQL is working.
Mario Majčica
4-Oct-11 5:23am
View
Deleted
Link is not working, it is not well formatted!
Mario Majčica
4-Oct-11 4:21am
View
As suggested earlier, call ToString() method on sb will passing it's content as parameter. Make sure that the last character in the sb is not ",".
Cheers
Mario Majčica
4-Oct-11 3:15am
View
Sometimes simple things can surprise! I love simplicity! ;)
Mario Majčica
3-Oct-11 7:54am
View
Try it! ;)
Mario Majčica
29-Sep-11 7:07am
View
Glad you like it! It is a good book and worth buying it. If helped, vote the answer and accept the solution.
Mario Majčica
29-Sep-11 3:19am
View
Try in this way http://tinyurl.com/3zp4znc
Mario Majčica
28-Sep-11 10:39am
View
On what UI; ASP.NET, WinForms, WPF...
Mario Majčica
25-Sep-11 11:03am
View
What is unclear? Just Google for some nice DIV tutorial!
Mario Majčica
25-Sep-11 10:44am
View
Nice one, I will upvote it if possible! :)
Mario Majčica
25-Sep-11 10:31am
View
Internet made people lazy and rude!
Mario Majčica
25-Sep-11 7:02am
View
But to Razanust it doesn't! :) Love people who ask and then disappear! :)
Mario Majčica
24-Sep-11 2:51am
View
Great than click on accept the solution so we can close this thread ;)
Mario Majčica
24-Sep-11 2:38am
View
Also you can find an valid example here
http://www.wrox.com/WileyCDA/WroxTitle/productCd-0764584642,descCd-DOWNLOAD.html
Cheers
Mario Majčica
24-Sep-11 2:37am
View
Once you return the DataReader from your DAL, close the connection (or let using doing it)
///
/// Retrieves all articles
///
public override List<articledetails> GetArticles(int pageIndex, int pageSize)
{
using (SqlConnection cn = new SqlConnection(this.ConnectionString))
{
SqlCommand cmd = new SqlCommand("tbh_Articles_GetArticles", cn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@PageIndex", SqlDbType.Int).Value = pageIndex;
cmd.Parameters.Add("@PageSize", SqlDbType.Int).Value = pageSize;
cn.Open();
return GetArticleCollectionFromReader(ExecuteReader(cmd), false);
}
}
where
///
/// Returns a new ArticleDetails instance filled with the DataReader's current record data
///
protected virtual ArticleDetails GetArticleFromReader(IDataReader reader)
{
return GetArticleFromReader(reader, true);
}
protected virtual ArticleDetails GetArticleFromReader(IDataReader reader, bool readBody)
{
ArticleDetails article = new ArticleDetails(
(int)reader["ArticleID"],
(DateTime)reader["AddedDate"],
reader["AddedBy"].ToString(),
(int)reader["CategoryID"],
reader["CategoryTitle"].ToString(),
reader["Title"].ToString(),
reader["Abstract"].ToString(),
null,
reader["Country"].ToString(),
reader["State"].ToString(),
reader["City"].ToString(),
(reader["ReleaseDate"] == DBNull.Value ? DateTime.Now : (DateTime)reader["ReleaseDate"]),
(reader["ExpireDate"] == DBNull.Value ? DateTime.MaxValue : (DateTime)reader["ExpireDate"]),
(bool)reader["Approved"],
(bool)reader["Listed"],
(bool)reader["CommentsEnabled"],
(bool)reader["OnlyForMembers"],
(int)reader["ViewCount"],
(int)reader["Votes"],
(int)reader["TotalRating"]);
if (readBody)
article.Body = reader["Body"].ToString();
return article;
}
Mario Majčica
22-Sep-11 17:31pm
View
Great, but what is the question?
Mario Majčica
22-Sep-11 8:39am
View
Viva the sense for the humor!
Mario Majčica
22-Sep-11 5:27am
View
I just tried and it is working perfectly. Let me know your mail if you want the working example!
Cheers!
Mario Majčica
22-Sep-11 4:22am
View
That's a new one for me! As far as I know, you just need to reference System.Configuration library and it will work like a charm. I will however check it this evening!
Mario Majčica
22-Sep-11 1:06am
View
Great, sorry but grappa last evening fooled up my logic!
Mario Majčica
21-Sep-11 5:44am
View
What the hell? :)
Mario Majčica
21-Sep-11 5:33am
View
Yes it is!
Mario Majčica
21-Sep-11 4:16am
View
Shame on them!
Mario Majčica
13-Sep-11 5:53am
View
This is not an Solution, it is a comment.
Mario Majčica
6-Sep-11 7:17am
View
Deleted
This is a comment not an alternative!
Mario Majčica
25-Aug-11 17:05pm
View
You are also new to English!
Mario Majčica
22-Aug-11 17:16pm
View
Why should you do that?
Mario Majčica
22-Aug-11 9:44am
View
How ever, instead of =Format(Fields!Date.Value,"yyyy/MM/dd" & " " & "h:mm:ss tt")
try following code:
public string CustomDateFormat(object dateTime)
{
if (dateTime == null || dateTime is DateTime == false)
return "n/a";
DateTime dateValue;
if (DateTime.TryParse(dateTime.ToString(), out dateValue))
return dateValue.ToString("yyyy/MM/dd h:mm:ss tt");
else
return "n/a";
}
and then modifying your code to following:
..= CustomDateFormat(Fields!Date.Value);
What is the output then?
Mario Majčica
22-Aug-11 9:19am
View
What it seems to be the problem is in your data feed. Check the content of your DataSet and see if there is any invalid DateTime value. You can do the check using the code I provided or by setting up a brake point inside your code.
Mario Majčica
22-Aug-11 9:02am
View
Check the edit.
Mario Majčica
22-Aug-11 8:33am
View
Can you be more specific? What troubles you precisely?
Mario Majčica
14-Aug-11 4:01am
View
I love gimmecode tag!
Mario Majčica
22-Jul-11 18:26pm
View
Tomorrow morning I'm leaving for 2 weeks of sun, certainly I'll not bring with me this "Error". Only real error in this post is the post itself!
Mario Majčica
22-Jul-11 9:17am
View
At least this one wrote "Please" ;)
Mario Majčica
22-Jul-11 8:58am
View
If I only could thumb up this comment! I adore this question style, "Our project doesn't build, I want an answer".
Mario Majčica
22-Jul-11 3:16am
View
It is actually not a good idea to make a round trip on each TextChanged event. You could easily do this via javascript on client side or on let say a button that commits this operation and generates the postback.
Mario Majčica
21-Jul-11 5:57am
View
You asked yesterday a similar question, http://www.codeproject.com/Answers/228904/what-is-meaning-of-Master-Form-fields-should-be-va#answer1 but as I suppose you probably didn't not even considered suggested solution.
Mario Majčica
20-Jul-11 10:36am
View
Please be more specific, which type of apps are and what precisely is the goal.
Mario Majčica
20-Jul-11 8:04am
View
Then the edited solution will work. If so, accept the solution and vote! ;)
Mario Majčica
20-Jul-11 7:05am
View
What kind of digits? Integers, decimals, ...?
Do you have an exemple of the txt file?
Mario Majčica
20-Jul-11 4:41am
View
This is a comment and not a solution!
Mario Majčica
18-Jul-11 6:16am
View
Are you sure that you never heard about pina.collada??? Aiaiaiaia...
Mario Majčica
18-Jul-11 6:15am
View
wtf? Didn't you read the article?
...
MyQueue.Send("<<Message>>", "<<Message Label>>")
...
etc?
Mario Majčica
18-Jul-11 6:03am
View
If this helped, then Accept solution so it can be closed.
Mario Majčica
18-Jul-11 5:42am
View
Take a look on updated solution.
Mario Majčica
18-Jul-11 5:20am
View
Deleted
This should be a comment and not an Alternate!
Mario Majčica
15-Jul-11 7:52am
View
Deleted
This should be a comment.
Mario Majčica
15-Jul-11 3:23am
View
Silly but it still cost less on Amazon, then like new on half.com!
Mario Majčica
4-Jul-11 7:08am
View
The http://www.imdbapi.com/ is not free?
Mario Majčica
4-Jul-11 6:03am
View
That's new W2008 anti-spam feature! Fails by design! :)
Mario Majčica
1-Jul-11 13:15pm
View
What is the UI that you will use, ASP.NET, WinForms, WCF, etc...???
Mario Majčica
1-Jul-11 13:13pm
View
Please try to express yourself properly. I can't understand what is your problem.
Mario Majčica
30-Jun-11 5:35am
View
What, where, how?!?! I can assume that for many of us English is not a mother tongue, but still, come on, what kind of question is this? Even in your mother tongue language will not be a proper question!
Mario Majčica
28-Jun-11 8:34am
View
Deleted
Why only for the strings? Could be a generic T as Append accepts an object and then tries to invoke ToString() method.
Mario Majčica
28-Jun-11 8:31am
View
Deleted
You are perfectly right. When I wrote this code down for the project http://dnpextensions.codeplex.com/ I was reimplementing an existing method and I was not thinking about the chance that it could be already done by fw. Good point! Thanks
Mario Majčica
28-Jun-11 8:09am
View
Deleted
And what is the down of this implementation?
Mario Majčica
28-Jun-11 7:00am
View
Down-voting without a comment? Really constructive...
Mario Majčica
18-May-11 2:42am
View
Try this http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/e56ee461-b9e0-43a2-a978-4276293d8b9b
Mario Majčica
23-Jan-11 15:40pm
View
Please ignore xmlns:soapenv="#unknown" attributes, they are added automatically by codeproject.
Show More