|
tell me folks, can i develop every application in C# that i can make in VC.net specially database applications??
shaz
|
|
|
|
|
depending on what you're trying to do...
C++ can access most of the system (and more) because it can code directly in assembly (with its asm keyword).
as C# is a .NET language, it will be limited by the functions provided by the framework.
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
well i m trying to make an application that will help a database layman to generate its dbms(mostly it will be on small scale)for its daily use.it would be only for retailer or salesman or other very small scale business.it would have 3 modules, in first one i have to get information from user by giving him select options.In second module i will have to create database in MSacces by running queries from my application(it would be using odbc) for the user based on the options he selected in first module.and in the third module i will have to create dialoges for user so that he can easily mantain his database.
now its only a project for the sake of learning which i want to complete as soon as possible, my teacher suggestd me to use VC.net but i am learning C# and want to use it for this project. so what idea u get from these details?could i go to C# for this purpose?
hope u'll help me
thanks again and again!! + prayers for u all
|
|
|
|
|
Absolutely - they both use the same layers for databases, all the work happens in your database anyhow. And any stuff C# does not offer, it can call from the C++ API dlls.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi all
If we want to make a regular expression to filter decimal numbers
is this one true or wat?
@"^\d+|(\d+\.\d+)$"
Programming is hard and
interesting
|
|
|
|
|
get expresso to check regex. I'd go with
@"^\d+.?\d+>$"
if it can be a whole number also
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi & thanx Chris
I check ur regular expression
But it didn't work correct in my sample:
private void button1_Click(object sender, System.EventArgs e)
{
if(Regex.IsMatch(textBox1.Text, @"^\d+.?\d+>$") || textBox1.Text == "")
textBox2.Text = "It's ok";
else
textBox2.Text = "It's not ok";
}
Programming is hard and
interesting
|
|
|
|
|
Should be a ?, not a +, at the last \d, sorry. This works for 0, 0.0 and 0., it does not work for .0
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi all,
I need to update client machines with the correct time if it is inaccurate. The server I'm using will always have the correct time so I'll be using that as the source of correct time. The code below works most of the time but is an an hour off sometimes (daylightsavings time).
For example, If I change the date on a local to machine to Jan 2005, my code will update the time an hour ahead of where it should be. Any help would be appreciated.
Thanks,Paul
Code is below
using System;
using System.Runtime.InteropServices;
public void UpdateTime(DateTime ServerTime)
{
TimeZone localZone = TimeZone.CurrentTimeZone;
DateTime localTime = localZone.ToLocalTime(ServerTime);
TimeSpan localOffset = localZone.GetUtcOffset(localTime );
ServerTime = ServerTime.Add(localOffset);
SetTime(ServerTime);
}
[StructLayoutAttribute(LayoutKind.Sequential)]
private struct SYSTEMTIME
{
public short year;
public short month;
public short dayOfWeek;
public short day;
public short hour;
public short minute;
public short second;
public short milliseconds;
}
[DllImport("kernel32.dll")]
static extern bool SetLocalTime(ref SYSTEMTIME time);
private void SetTime(DateTime NewTime)
{
SYSTEMTIME st;
st.year = (short)NewTime.Year;
st.month = (short)NewTime.Month;
st.dayOfWeek = (short)NewTime.DayOfWeek;
st.day = (short)NewTime.Day;
st.hour = (short)NewTime.Hour;
st.minute = (short)NewTime.Minute;
st.second = (short)NewTime.Second;
st.milliseconds = (short)NewTime.Millisecond;
SetLocalTime(ref st);
}
|
|
|
|
|
It's usually a lot easier to do this kind of thing in UTC. Call SetSystemTime rather than SetLocalTime - the system will then apply the appropriate correction to local time.
Windows (2000 and later) includes a Simple Network Time Protocol client. It's a lot easier to set that up and ensure it works. Configure with NET TIME /SETSNTP and set the W32time service to Automatic. If the servers are members of a domain they should already be using the domain controller as a time source: you then need to set the DC to fetch its time from an external source for all members to get the correct time.
Windows XP has an Internet Time tab on the Date/Time Control Panel applet if it's not a domain member. Server 2003 may be the same.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
SetLocalTime worked perfectly
Thanks,
Paul
|
|
|
|
|
I'm trying to profile a managed application's memory using PerfMon. I'm using the "# Bytes in All Heaps" performance counter and it does work fine. However, I'm not sure if that counter represents the heap size or just the allocated bytes on the heap.
If it represents just the allocated bytes, is there any way to find out the true size of the GC heap (the amount of address space it has reserved) at a particular point in time?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Need to design the model such that. web service(s) should send the data to the client whenever the data is changing in the the RDBMS data base.
eg. suppose more than one client is connected to the server. they are adding/updating/deleting data. This changes should reflact to all the connected user dynamically .
How should achive this kind of requirement using web service (In Smart Client architecture model).
|
|
|
|
|
What you're trying to achieve is not possible with webservices. The best way to do it would be to have the clients pool the server every 'x' seconds and see if there are changes.
A good way to do it is to assign each database update an "ID" (I love GUIDs for that). It would work this way: Client send the ID to the server. The server checks if the ID provided matches the last update ID. If it doesn't, the client will know it needs to pull data from the server.
|
|
|
|
|
Hi all,
I've got an application that I've added language capabilties by means of resource files and cultures. This works ok and I have no problem with it what-so-ever. I now want to add another resource that holds all the images my application will use. My problem comes whenever I try to use the resource. My app complains about the images resource or when I manage to sort that problem it complains about the language resource.
I have had both working on occasion but it seems to be very flakey and sometimes chooses not to work for no apparent reason other than the project being closed over night. Could someone explain to me the exact way in which to add .resX files to projects and what setting should be set in the project configuration because I think I may have misunderstood the process somewhere along the road.
Thanks in advance.
Richie
|
|
|
|
|
Hi, how would I get Regex to match everything BUT the expression "\\[a-z]\[\d+\]" (i.e. \a[2],\z[14],etc.)? I tried using ^ in brackets, but it only seemed to match single characters. For example, [^ab] took out all my a's and b's instead of taking out only "ab" in matches. How do I formulate a NOT this string expression? Thanks.
|
|
|
|
|
The [] means you've got a character set there. Try using look behind. This: (?<=ab) should find the character string 'ab' at the end of the current match, and exclude it from the result. But I'm not sure how the rest of the regex would work with it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Is it possible to create any kind of script page that would serve as a tunneling application on a server? ASP/PHP or a .NET Webservice? Then use a windows application to perform the tunneling, etc...just like http-tunnel and hopster.
|
|
|
|
|
Are you looking to be able to manage tunnels through a web app?
|
|
|
|
|
Yeah...is it possible? If not a regular page, maybe a .NET Web Service...I believe it should be possible: the Web Service should retrieve the given page (in the case of HTTP) and send them back to the client's Windows Form application...
I need to know how to make it work and if I could use it in tunneling SOCKS
|
|
|
|
|
You could write a tunnel which uses an XML configuration file. Then have it change it's settings whenver the file is updated. Then create a web application to edit the configuration file. The Configuration Application Block from Microsoft would work well for this.
If you want reporting from the tunnel, have it log to a file. I like XML logs. log4net can do whatever kind of log you want. Then you can create a web app to read, format and display the log file.
I'm personally working on a TCP proxy that will search and replace content in the stream. I've got the filters working fine, working with producer / consumer threads, but I can't get the proxy acting likce a TCP server and client working. Anything like what you're working on?
|
|
|
|
|
Yeah you could say we're stuck in the same field. Although, I wasn't even able to filter the stream (this is my first proxy project). Can u mail me ur work so far? I need to know how to exchange messages with the stream.
I found a very nice class that wraps all the proxying u need (HTTP, SOCKS and even FTP transfers). Just instantiate and call methods! I'm still in the early stages of testing it and it looks promising, however I need to go a little deeper in asynchronous programming (I still suck big time at that).
If you're interested let me know.
|
|
|
|
|
Hello everybody
I have writen dll file in C#. It is class with some functions i need to use in another application. But i need to have configuration file for this dll, to pass some parameters to it ( like app.config is for .exe application). How can i do it..?
If someone knows anything about it, please help!
Thank you
Eka
|
|
|
|
|
There's no built-in configuration feature - the assumption is that DLLs are simply libraries of code utilised by some application, and therefore that the application is configured - not the library.
If you want to read a file and treat it as if it were a configuration file, you can use a NameValueSectionHandler[^]. You'll need to give it an XmlNode pointing to the appropriate part of the file.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Thank you Mike.
I saw NameValueSectionHandler overview in MSDN and still i can't understand, how can i use it..
I need something like .config file (it can be even .txt file), wich will be in the same directory with my dll. i can't understand how to access this file from dll. it is easy for .exe, but for dll, i can't find the solution.
|
|
|
|