2,245 Posted Topics
Re: You want to perform the validation server side in c# code behind right? Here is how I do it: [code=c#] public static bool IsValidEmailAddr(string email) { try { System.Net.Mail.MailAddress addr = new System.Net.Mail.MailAddress(email); } catch { return false; } return true; } [/code] | |
Re: Open the gridview's smart tag and launch the column editor. Select the checkbox column and set the "ThreeState" property to false. See attached screen shot | |
Re: Your code: [code=vb.net] Private Sub cmdAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdAdd.Click Dim com As New OleDbCommand com.Connection = con com.CommandText = "insert into Watches values(" & txtWatchId.Text & ",'" & txtWatchBrand.Text & "','" & _ txtWatchModel.Text & "','" & txtManufacturer.Text & "'," & txtCountryOfOrigin.Text & "','" … | |
Re: Your syntax should be: [code=sql] Insert Into Table (Col1, Col2, Col3) Select Col1, Col2, Col3 From SomeOtherTable [/code] | |
Re: [code=c#] private void button1_Click(object sender, EventArgs e) { const string connStr = "Data Source=apex2006sql;Initial Catalog=Leather;Integrated Security=True;"; const string query = "Select * From Invoice Where InvNumber = @InvNumber"; using (DataTable dt = new DataTable()) { using (SqlConnection conn = new SqlConnection(connStr)) { conn.Open(); using (SqlCommand cmd = new SqlCommand(query, conn)) … | |
Re: You can use INSERT() statements: [code=sql] IF OBJECT_ID('Customer', 'U') IS NOT NULL DROP TABLE Customer Create Table Customer ( CustomerId int identity(1000, 1) PRIMARY KEY, CustomerName varchar(50), Address1 varchar(50), City varchar(50), State varchar(2), Zip varchar(5) ) Insert Into Customer (CustomerName, Address1, City, State, Zip) Values ('Scott', 'Street 1', 'City 1', … | |
Re: I don't understand what the question is or what you are trying to keep alive? You need to persist reminder information to disk some how with a database, configuration file, etc. | |
Re: I believe by default the SMTP default service does not have any fields marked to log. I'm sure windows is smart enough not to write out the log file if you have not enabled any fields to be logged. View the attached screen shot | |
Re: Please use code tags in the future. You're using 2 parameters in the query but only adding one to the command, the @Password variable is never used. See these threads for examples on using parameters: [url]http://www.daniweb.com/forums/thread191241.html[/url] [url]http://www.daniweb.com/forums/thread198304.html[/url] Here is an example of adding multiple parameters. Change the query and parameter … | |
Re: Don't use Regex, you're doing literal replacements not pattern replacements. Try: [code=c#] string Username = "Vuyiswa"; string Password = "secret"; string strBody = @"<p>Thank you for using !obooking System <br><br> Username:(Username)<br><br>Password:(Password)<br<br>Kind Regards !oBooking</p>"; strBody = strBody.Replace("(Username)", Username).Replace("(Password)", Password); [/code] | |
Re: Please see thread [url]http://www.daniweb.com/forums/thread191241.html[/url] as you are having the same issue. Use parameters when you build your query. Building queries with string values is dangerous because the user could potentially escape the input and write raw TSQL, in addition it hurts performance. Do something like: [code=c#] private void simpleButton1_Click(object sender, … | |
Re: What is a box character? [] is two characters and unix uses character 10 for a new line (\n), windows uses character 13 + character 10 for a line (\r\n). | |
Re: This may be inside of a c# application but these are all questions related to MSSQL. In the future please post SQL question to the proper forum. 1. No work around as far as I know. Most people value data integrity and if a single operation fails they want the … | |
Re: Use a mutex: MutexUt.pas: (Change 'LeatherPDF' to your application name) [code=delphi] unit MutexUt; interface uses Windows, Messages, SysUtils, Variants, Classes, Forms; function IsPrevInst: Boolean; procedure CheckPrevInstEx(MainFormClassName, MainFormCaption : String); implementation {---------------------------------------------} function IsPrevInst: Boolean; var semName, appClass: PChar; hSem : THandle; hWndMe : HWnd; appTitle: Array[0..MAX_PATH] of Char; begin // … | |
Re: This is the wrong forum, please post future SQL questions to the MSSQL forum (or respective rdbms). Try a query like this: [code=sql] Update Asset Set Unit = Asset.Unit - ( Select Sum(Store.Quantity) From Store Where Store.ItemCode = Asset.ItemCode ) [/code] The above query will work for a 1-to-1 or … | |
Re: Your connection string has a problem.. If you are using Integrated Security=True then you should not specify a user name and password. Also I think "uid=" is only valid for an MSSQL connection string if you are using the ODBC driver. I don't think it is valid for Native SQL … | |
Re: [QUOTE=serkan sendur;893922]it is a windows application, the problem is fixed i didnt understand how though. anyways you made just one more solved thread for nothing :) by the way, because of my minus repuation points, i plan to create a club in daniweb and i am going to name it … | |
Re: Yes, it will. You can add it back between elements of the array though. [icode] string s = string.Format("{0}-{1}", array[0], array[1]);[/icode] or something like [code=c#] private void simpleButton1_Click(object sender, EventArgs e) { string[] array = new string[0]; string result = string.Empty; foreach (string s in array) { result += (string.IsNullOrEmpty(result) … | |
Re: Ramy gave excellent advice on how to complete the hints. The auto completion and code documentation is called "intellisense" if you want to read more about it. | |
Re: Your professor is wrong you can use the Image data type to store any type of binary information. I store word document, pdf, etc with Image. Revert back to image and go from there... but don't tell your professor he is wrong! | |
Re: [QUOTE=petelaval;893187]Check out [url]http://jacanasoftware.com[/url]. Their templates feature multi level tabs, clean css, it validates, and the CSS won't mess with your controls. I highly recommend them.[/QUOTE] The OP was asking for Win Form templates/controls but used web controls as an example. Anyway, Developer Express has the best components -- in my … | |
Re: Post your assignment.mdb file here and I will give you the code. This thread has been open too long. | |
Re: Double click on "My Project" in the solution explorer, select resources, and "Add Existing File". You can navigate to the file and embed it as a resource. Note -- You can use tools like resource hacker or resource thief (i forget the name) to extract the raw data file. It … | |
Re: Paste the code for your generateRandomValue(); method. The problem is likely that when you have a break point that one second passes on your computers clock that changes the seed value for generateRandomValue(). You probably should use another GetRandomValue() method: [code=c#] private void simpleButton4_Click(object sender, EventArgs e) { List<int> lst … | |
Re: What exactly is the problem? If you're writing an application to close other unwanted applications, why would you be executing a batch file? Please clarify what you are asking here.. | |
Re: Why write a script? You can probably hack the environment up enough... : [code=bash] #!/bin/bash export PS1="C:\\w> " alias dir="ls -l" alias del="rm" [/code] [code] sk@sk:/tmp$ echo "" >> l sk@sk:/tmp$ del l -bash: del: command not found sk@sk:/tmp$ . dos.sh C:/tmp> del l C:/tmp> [/code] | |
Re: "this" refers to "this instance" of a class. You can use "this." to refer to properties and methods for the current class to help narrow down the intellisense menus as well as distinguishing between this.Method() and base.Method() if you are overriding a method from a base class. Here is an … | |
Re: File --- New Project. Add a project to the solution, it will be under "Other Product Types" -- "Setup and Deployment". You can use that for a Win Form app, for a web app there is a publish option if you right click on the web project in VS. | |
Re: [QUOTE=DMR;82345]You can certainly enable security measures after the fact.[/QUOTE] I know it is irrelevant to the thread but you have private messages disabled... I just wanted to let you know your avatar rocks. | |
Re: I would use generics here but I gave you three ways to accomplish your task depending on what framework you're using: [code=c#] using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using DevExpress.XtraEditors; using System.IO; using System.Linq; namespace daniweb { public partial class frmMainForm : … | |
Re: I don't understand what you're asking or how it relates to MSSQL. You're concerned with the programming languages over SQL so you might want to try another forum and ask a more specific question. | |
Re: Try this: [code=c#] txtOutput.Text += " " txtNotesEntry.Text; [/code] | |
Re: You consistently post in the wrong forum, this belongs in MSSQL. On top of that this question does not make any sense -- How do you configure a session before the session exists? Are you asking about ASP.NET session state integration with MSSQL, or the state of an SQL connection … | |
Re: Your biggest problem here is that you're calling the function to concat a string in the same query as you're distincting() the records. Lets say you have 5 unique people in the list but a total of 90 records then the function should only run 5 times but in this … | |
Re: [QUOTE=versatile36;890316]Whats the use of get and set in c# when we can add a property value like this [CODE]object.property="value"[/CODE][/QUOTE] The value is you encapsulate the field. In this case a caller can change the port and you have no control over the values of it: [code=c#] public int Port; [/code] … | |
Re: This is a forum to ask questions, not to post work and have it solved. Please ask a specific question about your task so we can help you. | |
Re: You can control the code editor's behavior by going to "Tools -- Options" then on the left expand "Text Editor", then CSS, then select "Format". Change the format style to "Compact Rules". I have attached a screenshot of how to change the setting. | |
Re: [QUOTE=NickMalone85;890019]Well then can someone tell me how do i store images in a database when performance is a factor? Eventually I might want to add a networking element to this program...[/QUOTE] If performance is a factor then you should be using a database to begin with. I can't think of … | |
Re: You need to have matching versions of Visual Studio and Microsoft SQL Server + SDK installed. So VS2008/MSSQL2008 for example. I have attached a screenshot of how to create the project. | |
Re: Are you wanting to do this one time or regularly.. and are you looking for a utility to do it or are you wanting to write an application? If you want to write something then what language are you developing in..? | |
Re: Try this out: [code=c#] string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Sounds"); [/code] | |
Re: Check out the mail templates sample at Code Project. I believe it is done in C# but it can be easily ported over: [url]http://www.codeproject.com/KB/IP/mailtemplates.aspx[/url] | |
Re: The assembly is referenced in your project references which can be managed using the IDE. As far as deciding to use which version, you need to compare them: [code=c#] private static VersionCompareResult CompareAppVerToDbVer() { using (DataTable dt = DatabaseSetup.GetSystemReg()) { if ((dt == null) || (dt.Rows.Count == 0)) { return … | |
Re: You use https:// in C# whenever you are accessing an https:// website. I don't really know of another way to answer that question. SSL is handled under the hood for the most part by the framework so you don't have to worry about it. Here is an example of an … | |
Re: [url]http://msdn.microsoft.com/en-us/magazine/bb985010.aspx[/url] Finalizers should be used for unmanaged resources such as final handles or network sockets and Dispose should be used for managed resources implementing IDisposable | |
Re: That depends on how your DAL is implemented but you can merely switch out the connection string which will connect you to another database. This queries two database: [code=c#] private void simpleButton1_Click(object sender, EventArgs e) { const string query = "Select * from sysobjects"; string connStr1 = BuildSqlNativeConnStr("apex2006sql", "Leather"); string … | |
Re: It sure is. You can also do this client side but here is a server side demonstration: Code Behind: [code=c#] using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace daniweb.web { public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if … | |
Re: I'm afraid I don't understand what you're asking. What I think you're asking is: When the program opens up the main form will let you select an XML file and open it. You want a list of the programs in the XML file to appear on the main form after … |
The End.