alc6379 120 Cookie... That's it Team Colleague

Are you saying your problem is that you don't have the type to reference in the client?

There are two ways of handling this-- if you just use the Employee item as a data transfer object between the data access layer and the service layer, then you should make another object that the service layer and the service client share as a data contract. Then, you turn the Employee object into that data contract object, and send it along.


If you don't want to do that, put the Employee class into its own project that can be referenced by all of the projects.

alc6379 120 Cookie... That's it Team Colleague

These are for GSM (cellular) modems, I think.... They may not be supported by your modem. You might want to check if your modem has an extended command set that supports what you're trying to do.

alc6379 120 Cookie... That's it Team Colleague

I think the error message is pretty clear, there-- you can only add references to Silverlight projects in Silverlight projects. Silverlight uses a subset of the .NET Framework, so you can't import in projects that use libs outside of that limited subset.

The only way you could really get around this is to build a web service with the functions you need, as Silverlight can hit web services.

alc6379 120 Cookie... That's it Team Colleague

I wrote a trojan not that long ago that wasn't detected by my antivirus. It did incredibly suspicous stuff too, like sending a list of running procs over TCP or UDP to a listener, running procs, accepting commands to run in the command-line, remote shutdown/restart, send clipboard data back and forth, inject code into running procs to intercept windows messages (keystrokes, mouse info, etc) it even had a little vnc pluging for complete remote control. I guess nothing in it exactly replicated any other virus out there, or AVG just sucks.

This stuff isn't really necessarily suspicious per se, except for opening ports, etc. Windows Firewall, by default, should prompt you to allow that communication out or not.

Basically, the "code signatures" are actual bytecode signatures that other viruses have been detected with-- you might have included a shared library from a virus, and used those functions. THEN the AV app would detect a potential problem.

alc6379 120 Cookie... That's it Team Colleague

What line are you getting that exception on?

alc6379 120 Cookie... That's it Team Colleague

Why aren't you setting the Primary key for the row and letting SQL server handle that? You should write a stored procedure to write the data, and if you need to get back the ID of the row that you just inserted, you can return the value of the SCOPE_IDENTITY() command.

alc6379 120 Cookie... That's it Team Colleague

That may not completely be the answer... Mono may do it, but there's no real status on how well Mono runs under AIX.

I think the real question is WHY would you want to do that? Why not use PHP, Perl, Ruby, or something else that is better suited to that environment?

kvprajapati commented: Alex you are right. +11
alc6379 120 Cookie... That's it Team Colleague

OK... I'm going to have to make some assumptions here:

You have 2 tabs, we'll say, Tab1 and Tab2. Tab1 has a button on it. You want to click this button and have it move to Tab2?

If that's it, you just have the method that handles the Button's Click() event set the tab control's SelectedIndex to the index number (probably 1) of Tab2.

http://msdn.microsoft.com/en-us/library/system.windows.forms.tabcontrol.selectedindex.aspx

I don't mean to sound ugly, but this is what I mean when I asked describe your issue in more detail. What elements are you working with? What is it doing now? What is it supposed to be doing? If this isn't what you wanted, then I just wasted my time answering the wrong question.

alc6379 120 Cookie... That's it Team Colleague

Google is your friend :)

http://www.startvbdotnet.com/

alc6379 120 Cookie... That's it Team Colleague

you could place that into a String variable, then use myVar.Split(vbCrLf) . That would create a String() array, and "This is a sample sentence" would be element 0 of the array.

a_salted_peanut commented: Brilliant and easy method! +2
alc6379 120 Cookie... That's it Team Colleague

instead of using date1 or date2, use String.Format("MM/dd/yyyy", date1) in your SQL statement. That should format it how you need.

alc6379 120 Cookie... That's it Team Colleague

Can you please provide more information? Your question isn't quite clear...

alc6379 120 Cookie... That's it Team Colleague

You'll just have to expose a property in movecategory:

private MyStructure Value
{
    get { return foo; }
}
alc6379 120 Cookie... That's it Team Colleague

You can totally use RAD to do object-oriented work... Again, RAD is the methodology, object-oriented is the development technique.

I'm generally using RAD to describe the process I enumerated in my previous post. The main idea is keep track of your tasks, and knock them out in the most effective order you've determined. Don't get stuck on methodology or terminology-- focus on producing a quality product for your client. That way, you're not trying to learn a management process as you go.

alc6379 120 Cookie... That's it Team Colleague

Questions:

Where are you getting your requirements from?
Are you required to produce a deliverable on a regular basis?
Are you expecting to add developers at any point?

If it's just going to be you, you should just take your requirements, sort them out task-by-task, order them estimated time to complete, versus "bang for the buck" in time to complete for the amount of importance to the project, then get cracking! (This is basically Rapid Application Development)

Test-driven development isn't so much a development methodology like Agile, RAD, or Waterfall. It's a software development process you'd use while developing. If your requirements are very clear, TDD is a way to go, but it can add considerable overhead to your project's time, as you'll be writing (and debugging) tests to verify your requirements are met.

selasedaniweb commented: Quite knowledgeable and trustworthy....thumbs up... +0
alc6379 120 Cookie... That's it Team Colleague

I'd just like to add another angle to this:

Say you have properties in an object that, when added together, you'd like to add the individual properties. You can overload an operator and output an object that is the addition (or difference, or whatever) of the two objects you just used the operator on.

alc6379 120 Cookie... That's it Team Colleague

Maybe you could write a webservice to send this email? Do that, and have your BLL reference the service, and use its methods to send the email?

alc6379 120 Cookie... That's it Team Colleague

Two things here:

Are these Class1,Class2, Class3 objects in a hierarchy? Are you using Interfaces or a superclass? It might be a good idea to have the method return the most concise type possible, as it's more type-safe. If your classes all do have a common set of operations or properties? Then you should have them all conform to an interface.

As far as an argument to a delegate is concerned, you just declare it with a variable:

public delegate void TestFunction(string myArg);

public void ThisIsMyDelegate(string myArg)
{
     //do something
}

TestFunction myFunc = ThisIsMyDelegate; 

//call it
myFunc("some string");
alc6379 120 Cookie... That's it Team Colleague

Generally I like to have at least 2 projects: 1 for my UI, and one for my logic. If you're doing a multi-tied application, I'd go even further, and have projects for UI, business logic, and data access.

If the application can be broken down into other sub-applications, I'd make individual projects for each (say, a banking application that has loan approval functions and report writing... report writing isn't tied directly to loan approval, so it is another application, technically)

alc6379 120 Cookie... That's it Team Colleague

Do you have more than one application in your project? Maybe there's some configuration that's not getting loaded, in that case?

alc6379 120 Cookie... That's it Team Colleague

All Hyperthreading really does is queue up more jobs to be run on the cores. In any case, more physical cores will be a better way to go.

If you really wanted to compare, you'd compare between the same chip, with Hyperthreading, and without. But, YMMV, as some applications run better WITHOUT Hyperthreading. Go figure...

alc6379 120 Cookie... That's it Team Colleague

None of the newer chips or motherboards support DDR. Perhaps you might want to look at getting an older chip to drop in that motherboard, if you're not willing to go whole-hog?

alc6379 120 Cookie... That's it Team Colleague

What I've been doing is using a stored procedure to read in the XML file as a string, then using OPENXML to get a table from the XML file. I'm just inserting a number of rows in the table, though-- I'm not updating.

This link helped me a bunch:
http://msdn.microsoft.com/en-us/library/aa276847(SQL.80).aspx

alc6379 120 Cookie... That's it Team Colleague

Yeah... you can't really change the index, like if the ID is 4, and it's the only one in the listbox, you're going to still access it as myListbox[0].

Just like kdcorp87 said, you can assign a value and a text property. You're probably looking for the Value property.

alc6379 120 Cookie... That's it Team Colleague

Where are you getting this DataTable from? Have you changed the routine you're using to get it?

alc6379 120 Cookie... That's it Team Colleague
FileStream fStream = newFileStream (strPath,FileMode.Append);
fStream.Close();
StreamWriter sWriter = newStreamWriter(strPath);
sWriter.Write(strBuilder);
sWriter.Close();

any help would be appreciated

You probably need to seek to the end of the file? It seems like that would be the way to go. The Streamwriter starts at position 0, I think, and just clobbers whatever is there...

alc6379 120 Cookie... That's it Team Colleague


also you could use List instead of ArrayList

List<int> numbers = new List<int>();

You don't really need the typed List for what's going on, it's just a nice thing to have in terms of type safety... :)

alc6379 120 Cookie... That's it Team Colleague

Check this cool bit of code out:

http://blogs.msdn.com/knom/archive/2008/12/31/ip-address-calculations-with-c-subnetmasks-networks.aspx

This guy has a pretty slick solution!

alc6379 120 Cookie... That's it Team Colleague

Could you maybe set a scan timeout for a shorter period of time, set that running on a thread, and have that thread check for some type of stop "signal" before scanning again? I think a Singleton pattern or something could work for this:

instantiate a "ScanMonitor" object that has a "Cancel" boolean property. (This can go to your scan() method)

Then, you could have another thread change ScanMonitor's Cancel property to "true" when you need to stop scanning.

set a while(true) loop to keep looping on that scan method with a short scan time, but before you scan, check if ScanMonitor.Cancel == true.

Does that make sense?

alc6379 120 Cookie... That's it Team Colleague

A web service would DEFINITELY be the way to go. Then, all you would have to have in a configuration file or hard-coded is the address of the web service you're connecting to. That's a much safer alternative than connecting directly to a database. You can even encrypt the connection between the client and the web service if you're using WCF...

alc6379 120 Cookie... That's it Team Colleague

Or, you can just instantiate the List with the ISingleResult:

ISingleResult<myType> isr;
List<myType> myList = new List<myType>(isr);

Either way should work, as the List<T>() constructor is overloaded to take any collection that implements IEnumerable<T>.

alc6379 120 Cookie... That's it Team Colleague

If you have a very large bunch of XML data, a string datatype isn't practical-- that string could potentially load hundreds of MB of data, risking a MemoryException being thrown if too much is loaded!

A stream is useful in many situations. I wrote a program that reads XML directly from a web service. The WebClient API returns that data as a stream, so that's how I read it in. Also, if you're doing an XMLReader instead of an XMLDocument, a stream is better suited, since you're going to be doing sequential reads from the XML stream, anyways. If you DO happen to read a large document, you minimize the chances of running out of memory. (XmlDocuments can still do this, though, so if you know you're going to be working with large documents, stick with the XmlReader).

Hope that helps! The big advantage to using streams is when you're working in a networked environment, like I mentioned.

alc6379 120 Cookie... That's it Team Colleague

looks like you could have an error in your query syntax:

"Select * From Codes Where User ID = " +

probably needs to look like

"Select * From Codes Where [User ID] = " +

The "missing operator is probably the runtime complaining that you don't have an "=" that it expects after the token "User".

alc6379 120 Cookie... That's it Team Colleague

You may have to create a custom deployment package to do this-- the default MSI creator doesn't afford you many options, but the deployment package project does:

http://msdn.microsoft.com/en-us/library/ms228283.aspx

alc6379 120 Cookie... That's it Team Colleague

Just to add to this:

If you're using reflection frequently because you have several classes that have the same method, you could consider casting those objects up to a defined interface. Say you have two classes, ClassA and ClassB. Both classes have a method called Run(), which you've defined in an interface called IRunnable:

public interface IRunnable
{
     public void Run();
}

ClassA a = new ClassA();
ClassB b = new ClassB();

//casting up to IRunnable
IRunnable aR = (IRunnable)a;
IRunnable bR = (IRunnable)b;

//you could then pass these IRunnables to any method that takes an IRunnable as a parameter, for instance.

private static void MakeRun(IRunnable r)
{
     r.Run();
}

MakeRun(aR);
MakeRun(bR);

...This is a really simple example, but I hope you get a good idea. You can do similar things with Interfaces that you can do with Reflection. I think it's cleaner to use Interfaces because you then have type-safety when executing those methods when returning values and inputting parameters.

alc6379 120 Cookie... That's it Team Colleague

Remove the object[] argument from your MoveUp() method. You don't need it.

Also, when you do the BeginInvoke, it should look like this:

MainForm.BeginInvoke(MoveUp, null);

a params object means you can have one or many objects as a parameter to pass to your method. The BeginInvoke feeds those objects to the method's signature, in case the method takes any. If the method you're invoking doesn't require any parameters, then simply use null. It's worked for me...

alc6379 120 Cookie... That's it Team Colleague

Hi,
1) Is it better to create one dataset for the whole project than many smaller (like one for each form)?

Depends. If you're using the datasets in the designer view, you really don't have THAT fine-grained of a control over when the datasets are instantiated, and how long they stick around in memory.

2) If I have 2 datasets, both has tableadapters that connects to the same data. Both table adapters load data to tables. Now, data in one of those tables changes and appropriate tableadapter updates the DB with it. Is data in second dataset also updated??

No. Even if the "source" of the data is the same, the Dataset is a completely different object that has its own contents. You have to update both datasets to have accurate contents.

3) I load, lets say, 1 column from DB to column of table that has tree columns (two stay empty). Now I use only data from that 1 column, but in some moment I need to load also the other 2 columns. If I use .Fill() method of appropriate table adapter will it reload the first column of the table even if it contains identical data as DB??

Please help me with these questions. They are somewhat important if I'm to write fast DB app.

You'd have to change the SelectCommand of the TableAdapter to get this new data. As such, it's a different Data set entirely. You could order them differently, or something.

alc6379 120 Cookie... That's it Team Colleague

Why don't you have permission to install updates? Is your machine locked down or something?

Best route would be to contact your system administrator. They should authorize you to install the software if it's something you really need on there...

alc6379 120 Cookie... That's it Team Colleague

Sounds like an awfully ambitious project for a beginner... Have the people requesting the application specified what requirements they need, exactly? That sounds like the best place to start...

alc6379 120 Cookie... That's it Team Colleague

you could use a set of if statements or something.

basically,

string myValues = "" //initialize the string

if (chkAlt.Checked == true)
{
       myValues = myValues + " Alt";
}

//...and so forth

Then, you'd create an OleDBCommand or SqlCommand that contained the ID. Something like:

"UPDATE tbl_values SET columnName = " + myfield + " Where ID = " + myRow;

You still need to figure out what your ID is. But, that code I just gave you is what the CommandText of your SqlCommand or OleDbCommand might look like. Then, you'd run the ExecuteNonQuery() of your command. That should commit it to the database.

alc6379 120 Cookie... That's it Team Colleague

What if it converted floats over to ints automatically? What would it do with the fractions?

scru makes an excellent point. When you're working with a type-safe language, one of the key points is that the compiler is going to be VERY picky about making sure types match up.

Personally, I wouldn't even use the explicit conversion unless I absolutely had a good reason...

alc6379 120 Cookie... That's it Team Colleague

What kind of hard drive are you trying to install on? You probably need to load the Drivers for your hard drive controller at the F6 screen during the XP install.

alc6379 120 Cookie... That's it Team Colleague

if those are the only codes that you'll be using, couldn't you just use string concatenation on it? Ie, if you had one that was "alt LaF" would could just input that in as a string.

From that standpoint, when you updated it, you would have to make sure that you updated ALL of it, ie, if you wanted to change "alt LaF" to "alt sy ord." ,you would want to make sure that each value is explicitly updated when you do it.

Does that make sense? Otherwise, you'd need to set up a normalized database, with a row representing each code that applied to that bit of data, joined together.

alc6379 120 Cookie... That's it Team Colleague

Alternatively, you could create a templateField for the fields you want to validate, and use an ASP.NET validator control in that templateField. I've had that work without issue...

It does require knowledge of templateFields. Fortunately MSDN has good documentation on them:

http://www.asp.net/learn/data-access/tutorial-12-cs.aspx

alc6379 120 Cookie... That's it Team Colleague

hi
i am new to asp.net and can i have the details od automatic sending mail...
here iam using SQL server 2005 and sql 2000 so how can i do the above methods?
please explain in brief...

Saiveena,

Please reread this entire thread before posting a question. A user has previously provided pretty explicit steps on how to accomplish this.

alc6379 120 Cookie... That's it Team Colleague

Why not store all the usernames in an array to begin with, then bind that Listbox to the array as a datasource? Then you already have a data structure there to work with.

Or alternatively, the ListBox should have an Items property that you can iterate through, pretty much just like you're using an array already. You could do Items[x].Value , if I recall correctly. No need for a separate array there.

alc6379 120 Cookie... That's it Team Colleague

yep. I think that you're right there. I'm pretty sure the data tools in the IDE are removed from the Express Edition...

But hey on the bright side-- at least you're getting really familiar with those controls, right? ;)

alc6379 120 Cookie... That's it Team Colleague

you might want to check out these two links:

http://msdn2.microsoft.com/en-us/library/ykdxa0bc(VS.80).aspx

http://msdn2.microsoft.com/en-us/library/t4a23xx4(VS.80).aspx

I think a combination of adding logic in your program to do the same constraint validation, as well as handling the exception when the underlying DB raises it will produce the result you require.

alc6379 120 Cookie... That's it Team Colleague

My favorite drink... I invented it:

The Big Al

  • 1 can of Osotspa M-150 energy drink, imported from Thailand. (Can use Carabao for more pep!)
  • 2 shots of Vodka

The vodka kind of lightens up the mood, so to speak, and then the M-150 has about 200% your RDA of Vitamin B6, so later on that night, you'll have the energy to keep partying!

alc6379 120 Cookie... That's it Team Colleague

What are all of the system specs? Are we sure the disc is properly burnt?