I have ~10,000 records would like to keep in a collection in memory and execute LINQ queries against it. This collection should be available for all the users in the application domain and can access concurrently. I’m looking for a .NET collection that supports multithreading can query asynchronously and efficiently without any threading issues. Any suggestions on deciding a collection for this?
I am developing a Client-Server based application in which client application will access server database to store billing information. It will also have report generation facility. Windows Forms is good in document printing & I don't see such facility or controls in WPF. If I am wrong then please correct me.
I want database security, which DB should I use, SQL Server, MySQL or Oracle. I would like to use free DB but security is my priority.
Please suggest how I can implement a Client-Server architecture with multiple clients in C#?
Thank you Geeks!!!
I had data in mysql, where it does not need any security.
I had a sql query string to get the data out every time using mysql_fetch_assoc.
So, I planed to store data in users browser.To reduce no of quires to sql.
if (!isset($_COOKIE['countries'])){
$query = "SELECT iso,name FROM sel_country";
$countries = mysql_query($query);
setcookie('countries', serialize($countries), time()+3600);
}else{
$countries = $unserialize($_COOKIE['countries']);
}
while ($row = mysql_fetch_assoc($countries)) {echo $row['name']}
But, When cookie is set it is showing following error
Fatal error: Function name must be a string in /home/worlds/public_html/index/ctrl.php on line 15
My cookie in browser displaying content as i%3A0%3B
Please help me out, how should i go?
this is my sample xml.
<Messages>
<Conversation>
<id>Z100</id>
<ReplyToId></ReplyToId>
<Message>Topic</Message>
</Conversation>
<Conversation>
<id>A100</id>
<ReplyToId></ReplyToId>
<Message>This is a test</Message>
</Conversation>
<Conversation>
<id>M100</id>
<ReplyToId>A100</ReplyToId>
<Message>What kind of test</Message>
</Conversation>
<Conversation>
<id>A200</id>
<ReplyToId>M100</ReplyToId>
<Message>Stage 1</Message>
</Conversation>
<Conversation>
<id>M200</id>
<ReplyToId>A200</ReplyToId>
<Message>Test result for </Message>
</Conversation>
</Messages>
How to get the conversation list based on id using linq in C#. Say for example, If i want to get the conversation for id "A100" which has a link to other conversation based on ReplyToid.
A client of mine has a pure HTML website that was built in the dark ages - they want me to find where their users are coming from, how many individual users there are, etc.
They want to know if the site is being used enough for them to invest the money into renovating it.
I am remote from their site and do not have access to their web server.
Is there something like ComScore for small sites that I can go into to check their usage statistics?
I am developing an application in C# WPF which will have Client-Server architecture (Client will do products sales billing). I am novice in this area and I asked this question to start my development process.
Click here to view question.
So, ultimately I have selected MySQl, WCf & WPF. Now I have one silly question. Do i need to handle DB concurrency explicitly in my application (like 3 clients inserting data same time) or MySQl will handle this without any conflict?
To accomplish my project i thought, I will create a service in WCf which will do DB queries from client application. Do you have any suggestion to improve my application performance.
I would like to name my css file mystyles.php. All content within will still be css. I'd like to then include this into my index.php page without using the standard HTML <link> tag. Any direction would be appreciated very much.
I have billing application based on C# WPF, Screenshot is here. as you can see there is a datagrid, programmatically binded. this datagrid contains lists of item going to be billed.
So when user reaches "Print memo" part (in stack panel 2) i have to update listed items in stock table and insert entries in sales table and finally print the memo.
I want to know is there any speedy way to so because as user gives print command I have to clear datagrid which holds product lists and start accepting new lists.
if you could provide few code or link, will be really helpful..
thanks.........
If I am wrong then please correct me as I am new in this. I have one thread which display image captured from webcam on a windows created using CreateWindowEx() function. Now when i execute my program I can see that my paint code (in WindowProc()) in never reached (called InvalidateRect() from child thread to redraw), checked using breakpoint.
Actually frame capture and display is being done in thread and I think because its in child thread and Window is in Main thread that is why its not able to call paint event.
Can you help me on this
Hi,
I have a CSS style using child selectors in an HTML page as follows:
<html>
<head>
<title>MSO Bug</title>
<style type="text/css" media="screen,print">
ol{list-style-type:decimal;}
ol > ol {list-style-type:lower-alpha;}
ol > ol >ol {list-style-type:lower-roman;}
</style>
</head>
<body>
<div>
<ol>
<li><div>level1</div></li>
<ol>
<li><div>level2</div></li>
<ol>
<li><div>level3</div></li>
</ol>
</ol>
</ol>
</div>
</body>
</html>
In Firefox, the CSS works properly - the first list level starts with '1', the second with 'a', and the third with 'i' as expected.
But this doesn't work in IE7/8!
(I'm aware of descendent selectors - for some reason I can't use that here)
hi all,
i am developing one eclipse plugin. now when user click on any file/folder and click icon(added by me) then i have to get that file location.
can you please help me regarding this one.
Thanks in advance.
Can someone please help?
I use Google code’s Moq framework for mocking within my Unit Tests and Unity for Dependency Injection.
In my Test class
private Mock<ICustomerSearchService> CustomerSearchServiceMock = null;
private CustomerService customerService = null;
private void SetupMainData()
{
CustomerSearchServiceMock = new Mock<ICustomerSearchService>();
customerService = new CustomerService ();
// CustomerSearchService is a property in CustomerService and dependency is configuered via Unity
customerService.CustomerSearchService = CustomerSearchServiceMock.Object;
Customer c = new Customer ()
{
ID = "AT"
};
CustomerSearchServiceMock.Setup(s => s.GetCustomer(EqualsCondition)).Returns(c);
}
[TestMethod]
public void GetCustomerData_Test_Method()
{
SetupMainData()
var customer = customerService.GetCustomerData("AT");
}
public static bool EqualsCondition(Customer customer)
{
return customer.ID.Equals("AT");
}
In my Test class CustomerService class
public class CustomerService : ICustomerService
{
[Dependency]
public ICustomerSearchService CustomerSearchService { get; set; }
public IEnumerable<SomeObject> GetCustomerData(string custID)
{
I GET Null for customer ?????}
var customer = CustomerSearchService.GetCustomer (c => c.ID.Equals(custID));
//Do more things
}
}
When I debug the code I can see CustomerSearchService has a proxy object, but the customer returns as null. Any ideas? Or is there something missing here?
Note: ICustomerSearchService I have implemented below method.
Customer GetCustomer(Func<Customer, bool> predicate);
I 'm not familiar with VB.NET at all. I need to convert this function to C#. Can anyone please give me a hand?
Public Function GetAppGUID(ByVal sectionId As String) As String
Dim hexString As String = Nothing
Dim i As Integer
Dim guidlen As Integer
guidlen = 16
If sectionId.Length < guidlen Then
sectionId = sectionId & New String(" ".Chars(0), guidlen - sectionId.Length)
End If
For i = 1 To guidlen
hexString = hexString & Hex(Asc(Mid(sectionId, i, 1)))
Next
GetAppGUID = hexString
End Function
Hi
Is there a better simplified way to write this query. My logic is
if collection contains customer ids and countrycodes, do the query ordey by customer id ascending. If there are no contain id in CustIDs then do the order by customer name. Is there a better way to write this query? I'm not really familiar with complex lambdas.
var custIdResult = (from Customer c in CustomerCollection
where (c.CustomerID.ToLower().Contains(param.ToLower()) &&
(countryCodeFilters.Any(item => item.Equals(c.CountryCode))) )
select c).ToList();
if (custIdResult.Count > 0)
{
return from Customer c in custIdResult
( c.CustomerName.ToLower().Contains(param.ToLower()) &&
countryCodeFilters.Any(item => item.Equals(c.CountryCode)) )
orderby c.CustomerID ascending
select c;
}
else
{
return from Customer c in CustomerCollection
where ( c.CustomerName.ToLower().Contains(param.ToLower()) &&
countryCodeFilters.Any(item => item.Equals(c.CountryCode)) )
orderby c.CustomerName descending
select c;
}
What is the best way to return only few properties to JSON Result from a collection IEnumerable?
Department object has 7properties I only need to 2 of them in client. Can I do this using C# anonymous types?
public class Department
{
public string DeptId { get; set; }
public string DeptName { get; set; }
public string DeptLoc1 { get; set; }
public string DeptLoc2 { get; set; }
public string DeptMgr { get; set; }
public string DeptEmp { get; set; }
public string DeptEmp2 { get; set; }
}
[HttpGet]
public JsonResult DepartmentSearch(string query)
{
IEnumerable<Department> depts = DeptSearchService.GetDepartments(query);
//Department object has 15 properties, I ONLY need 2 (DeptID and DeptName) in the view via returns JSON result)
return Json(depts, JsonRequestBehavior.AllowGet); // I don’t want all the properties of a department object
}
I have to projects in my .net windows forms, in one form(1st Project) i have timer control already running.
On some request i want to start that timer from the form1 of (second project).
If we are creating new object in second project for the 1st project(Which is currently in running thread) we will not be able to start the timer for the current instance.
How can we access the current running instance from my 2nd project.
Please suggest me some method
Hello
I have two histograms.
int Hist1[10] = {1,4,3,5,2,5,4,6,3,2};
int Hist1[10] = {1,4,3,15,12,15,4,6,3,2};
Hist1's distribution is of type multi-modal;
Hist2's distribution is of type uni-modal with single prominent peak.
My questions are
Is there any way that i could determine the type of distribution programmatically?
How to quantify whether these two histograms are similar/dissimilar?
Thanks
Hi
Both do the same thing. What is the most efficient way to compare two strings?
Equals() or Compare()? Are there any differences?
if (String.Equals(StringA, StringB, StringComparison.OrdinalIgnoreCase))
{
// Your code goes here
}
if (String.Compare(StringA, StringB, true) == 0)
{
// Your code goes here
}
Possible Duplicates:
How to calculate age (in years) based on Date of Birth and getDate()
How do I calculate someone’s age in C#?
How to calculate the customer age automatically by using their Date of Birth
using c# and SQL Server 2005
I'm trying to link the Boost Serialization Library to my Code. But it doesn't seem to be working.
g++ serialize.cpp -L"/usr/local/lib/libboost_serialization.a"
Error :
/tmp/ccw7eX4A.o: In function boost::archive::text_oarchive::text_oarchive(std::basic_ostream<char, std::char_traits<char> >&, unsigned int)':
serializep.cpp:(.text._ZN5boost7archive13text_oarchiveC2ERSoj[_ZN5boost7archive13text_oarchiveC5ERSoj]+0x25):
undefined reference toboost::archive::text_oarchive_impl::text_oarchive_impl(std::basic_ostream &, unsigned int)'
..........
collect2: ld returned 1 exit status
But when i link as a shared library,
g++ serialize.cpp -lboost_serialization , it works fine.
What am i missing here
P.S : Other StackOverflow posts with the same question has no answers that work for the above error