
mocella
Avatar/Signature-
Posts
278 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by mocella
-
returning values struct vs. class/ref vs. value
mocella replied to bri189a's topic in Interoperation / Office Integration
Two things - what does your update statement look like for that data-adapter, and second, how is that column in the database defined? -
Creating a data table from a .net program
mocella replied to carpe2's topic in Database / XML / Reporting
That syntax for creating the table is correct. Are you using myCommand.ExecuteNonQuery for your command? If so and you're getting an error, do a try...catch block and paste the exception for us all to look at. One other thing to check is that SA still has dbo on your database called Laboratorios (in case that permission was dropped somewhere along the line). -
Creating a data table from a .net program
mocella replied to carpe2's topic in Database / XML / Reporting
If you're asking how you'd delete a table from SQL Server through a sql script, here's your syntax: DROP TABLE table_name However, you'll need to use an account with sysadmin or db_owner and db_ddladmin permissions for this to work. I have to ask - what's your reason for creating/deleting these tables in this fashion and what version of SQL Server are you on? -
Reading a text file in real time...
mocella replied to TJC's topic in Directory / File IO / Registry
Take a look at FileSystemWatcher -
Inserting Records--Visual Studio.Net
mocella replied to LadyGail's topic in Database / XML / Reporting
Now that I look at what I told you, that approach is not really good (appending values to the string like I initially said - leaves you open to sql-spoofs). Is it possible for you to create a stored procedure to do this? That's pretty much how I always do stuff (especially from a web page). As for that string value, are you ever setting TrackingDivision's value equal to some textbox's value? -
Try something like: Here's your stored proc: CREATE PROCEDURE InsertAnImage @recordID integer @imageData image AS Insert Into ImageTable ( imageID, imageData ) Values ( @recordID, @imageData ) Once you have this, set up a command object that calls this stored-proc and append your parameters (one being type int, the other being type Image) and exec your proc.
-
Inserting Records--Visual Studio.Net
mocella replied to LadyGail's topic in Database / XML / Reporting
Your insert should be: sqlInsert.CommandText = "Insert into PerformanceMeasures ( TrackingDivision, PerformanceMeasures ) Values( '" + strTrackingDivision + "' , '" + strPerformanceMeasures + "') " sqlInsert.CommandType = CommandType.Text sqlInsert.Connection = conn sqlInsert.Connection.Open() sqlInsert.ExecuteNonQuery() sqlInsert.Connection.Close() note, you'll probably need those single-quotes around your strings -
In Solution Explorer, under your project, there's a folder called References. Right-click this, select "Add Reference" and in the first tab (.Net Assemblies), scroll to System.Web and select it. Once you have that done you should be able to compile and run your code.
-
I only had to add a reference to System.Web, but I'd imagine he's already done that to even compile.
-
It wants you to sign your assembly with a strong-key file. Do a search on this site or MSDN and you should find exactly what you need to do for this. If not let me know.
-
For .Net assemblies, you can try to use Reflector, which is a pretty nice utility for this type of thing.
-
I'm not sure if any of this matters, but I'm running VS2002/2003 Enterprise Architect and also have Outlook 2002 installed on my development machine. My smtp server was a local domain Exchange server. Before I posted that code yesterday, I successfully sent my message. Perhaps your smtp server requires credentials to be specified? Which line was it that caused the exception, and perhaps if you could post the exception text I can see what's happening better.
-
That should do the trick.
-
Did you look at the InnerException on your call? For example: try { myServiceObject.CallWebMethod(); } catch( Exception ex ) { console.WriteLine( ex.InnerException.ToString() ); }
-
Try this: Imports System.Web.Mail private sub SendAMessage() Dim subjectLine As String Dim emailToSend As New MailMessage Dim messageBody As String 'CREATE MESSAGE BODY Try messageBody = txtMessage.Text 'CREATE MESSAGE HEADER subjectLine = "I sent this email from a WinForms App." emailToSend.From = "TextAccount" emailToSend.To = txtEmailTo.Text emailToSend.Body = messageBody.ToString emailToSend.Subject = subjectLine SmtpMail.SmtpServer = "yourSmtpServerAddress" SmtpMail.Send(emailToSend) Catch ex As Exception Throw ex End Try emailToSend = Nothing end sub
-
How do I pass DataRows from Public to Private subs?
mocella replied to Adam's topic in Windows Forms
You pass them the same as any other situation, unless I misunderstood your question. I think you're asking if you can do this - so that in DoSomeWork you'll see a value of "1" displayed after you pass the value: Public Sub DoSomeWork() Try Dim myCounter As Integer = 0 AcceptSomeParms(myCounter) MessageBox.Show("count: " & myCounter) Catch ex As Exception Console.WriteLine(ex.ToString()) End Try End Sub Private Sub AcceptSomeParms(ByRef localCounter As Integer) Try localCounter += 1 Catch ex As Exception Console.WriteLine(ex.ToString()) End Try End Sub -
You'd probably be better served to use something like C/C++ outside of .Net. There used to be a fairly cheap Borland C compiler that I picked up in college (think it ran me like $40). That way, you'll be responsible for everything - memory allocation, stacks, pointers all that good stuff, without .Net taking those liberties for you.
-
You need to do a replace on the .Text fields to replace all single quotes with two single quotes. I think it'd leave you with something like this (although I'm not at a computer with VS on it so this is a guess): Insert_Special ' " & txtABNo.Text.Replace( "'", "''") & " ' , ' " & _ txtSubmittedDate.Text.Replace( "'", "''") & " ' , ' " & _ txtPurTesting.Text.Replace( "'", "''") & " ' , ' " & _ txtClaimsEntered.Text.Replace( "'", "''") & " ' , ' " & _ txtPerformProvider.Text.Replace( "'", "''") & " ' " (that looks weird: .Replace( "'", "''"), but it's doing what I said in text in the beginning) Also, I usually just include a helper function in my projects that I call SqlQuote that does this for me, so I don't have to keep writing that damn .Replace( "'", "''") all over the place, and in case there's further parsing I need to do globally to parms. Let me know how that works.
-
I hear that - I didn't get MCSD until I have 5 years experience and felt that I had skills to back up the certification. Trust me - when my coworker that was also MCSD (this is before I was MCSD mind you) asked me how to fill a dataTable and bind a datagrid to it, I had serious doubts that I'd ever bother with getting certified. However, now that I spent my lunch hour for 4 straight months, and then some to do my studies, I feel I'm much more knowledgable in .Net than before I did this, and I have about 1.5 years on large scale .Net projects prior to that.
-
I can only see an MCSD counting against you if you're using it to replace experience - since there's too many exam cheaters out there. However, if you have it AND experience and can back it up in a tech interview, I don't see if counting against you. If it did, then you probably talked to a company that got burned when they hired a cheater who had their MCSD/MCSE and got hired as a supposed expert. The company probably figured out too late that they had hired a moron who couldn't code their way out of a shoe-box (okay, silly example, but you get the idea). I'll be the first to admit - I used to work with a lot of these people when I consulted - that was the consulting company's #1 goal - to get X-number of MCSDs to use in their pitch to clients. I've had "MCSD"-certified developers ask me how to databind a datagrid to a datatable - which is such a huge topic in the tests that it's abundantly clear they cheated their way through the cert, and further cheapened the cert. Okay, I'm done ranting now.:D
-
Try something like this in your user control - I had this same issue and this worked for me: protected override bool OnBubbleEvent(object source, System.EventArgs args) { ImageButton myBtn = new ImageButton(); //TYPE COMPARISON OBJECT if( source.GetType().Equals(myBtn.GetType())) { ImageButton oButton; oButton = (ImageButton)source; switch (oButton.ID) { case "btnSave": { //DO SOMETHING AFTER A "SAVE" CLICK DETECTED break; } ..... } return true; }
-
You can do this via the web.config (if you have a short list of users), or you can call some function in your form loads to check if the logged in user is found in your user database.
-
I don't recall those books being $50 when I bought them off bookpool, but then again, I didn't see that line last time I checked. If you have the funds available, go for at least MCAD, if not MCSD.net - that seems to be the bigger keyword hit on Monster or Dice.
-
Here's the language specs on how C# allocates memory: http://www.superdotnet.com/csharp_onlinespec/2514.aspx Are you trying to perform your own memory allocation/deallocation in .Net, or are you using java or pure C/C++ and you're just asking about it here?
-
I also used the Osbourne Press collection for my MCSD.net readings. I found them to be quite readable as far as technical books go, but then I'm probably one of the few in my department that has actually read each of my tech books front to back. I used those and then Transcender software to determine where my weak points were and studied up on those. As you take the tests, you'll see a lot of repeated topics/questions, so by your third tech test (70-305, 70-306, 70-310) you should breeze through a good portion of it. 70-300 was a different story though - very subjective, but just remember that Microsoft is trying to hawk their latest and greatest, so stick with the latest technologies in the answers (90% of the time) and you'll be fine.