2,245 Posted Topics

Member Avatar for erictheking1

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]

Member Avatar for sknake
0
117
Member Avatar for reniies

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

Member Avatar for reniies
0
126
Member Avatar for manutd4life

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 & "','" …

Member Avatar for kvprajapati
0
117
Member Avatar for Traicey

Your syntax should be: [code=sql] Insert Into Table (Col1, Col2, Col3) Select Col1, Col2, Col3 From SomeOtherTable [/code]

Member Avatar for kvprajapati
0
130
Member Avatar for nmakkena

[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)) …

Member Avatar for sknake
0
165
Member Avatar for seblake

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', …

Member Avatar for seblake
0
145
Member Avatar for Cman2020

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.

Member Avatar for Cman2020
0
302
Member Avatar for hellboy_83

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

Member Avatar for sknake
0
131
Member Avatar for S2009

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 …

Member Avatar for sknake
0
88
Member Avatar for vuyiswamb

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]

Member Avatar for vuyiswamb
0
117
Member Avatar for brainbox

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, …

Member Avatar for brainbox
0
664
Member Avatar for Codesearcher

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).

Member Avatar for msvinaykumar
0
152
Member Avatar for havejeet

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 …

Member Avatar for sknake
0
153
Member Avatar for BradenMurphy

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 // …

Member Avatar for mediastar
0
171
Member Avatar for Manak

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 …

Member Avatar for sknake
0
116
Member Avatar for virang_21

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 …

Member Avatar for smithroy9
0
151
Member Avatar for serkan sendur

[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 …

Member Avatar for serkan sendur
0
77
Member Avatar for SusanHAllen

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) …

Member Avatar for Ramy Mahrous
0
225
Member Avatar for seebharath

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.

Member Avatar for seebharath
0
119
Member Avatar for sid78669

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!

Member Avatar for sid78669
0
105
Member Avatar for zmariow

[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 …

Member Avatar for sknake
0
681
Member Avatar for clueless123

Post your assignment.mdb file here and I will give you the code. This thread has been open too long.

Member Avatar for clueless123
0
129
Member Avatar for Raouldukey

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 …

Member Avatar for Raouldukey
0
266
Member Avatar for petya.ivanova

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 …

Member Avatar for petya.ivanova
0
158
Member Avatar for guahack

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..

Member Avatar for guahack
0
83
Member Avatar for Xessa
Member Avatar for ViLeNT

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]

Member Avatar for sknake
0
141
Member Avatar for fdelriog

"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 …

Member Avatar for sknake
0
127
Member Avatar for sivak

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.

Member Avatar for sknake
-1
83
Member Avatar for server_crash

[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.

Member Avatar for sknake
0
779
Member Avatar for HTCGuy

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 : …

Member Avatar for sknake
0
114
Member Avatar for 3xxx

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.

Member Avatar for Ezzaral
0
89
Member Avatar for Cman2020
Member Avatar for Cman2020
0
383
Member Avatar for sivak

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 …

Member Avatar for sknake
0
52
Member Avatar for vuyiswamb

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 …

Member Avatar for vuyiswamb
0
160
Member Avatar for versatile36

[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] …

Member Avatar for versatile36
0
176
Member Avatar for neonle

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.

Member Avatar for sknake
0
56
Member Avatar for kkemerait

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.

Member Avatar for sknake
0
271
Member Avatar for NickMalone85

[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 …

Member Avatar for sknake
0
76
Member Avatar for sivak

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.

Member Avatar for sknake
0
52
Member Avatar for Suryaahh

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..?

Member Avatar for cutepinkbunnies
0
71
Member Avatar for serkan sendur

Try this out: [code=c#] string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Sounds"); [/code]

Member Avatar for serkan sendur
0
456
Member Avatar for killhha
Member Avatar for David Mac

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]

Member Avatar for sknake
0
93
Member Avatar for sivak

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 …

Member Avatar for sivak
0
69
Member Avatar for sivak

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 …

Member Avatar for sknake
0
166
Member Avatar for sivak

[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

Member Avatar for thewebhostingdi
0
88
Member Avatar for sivak

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 …

Member Avatar for thewebhostingdi
0
239
Member Avatar for SID.SIL

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 …

Member Avatar for thewebhostingdi
0
150
Member Avatar for N3oblaster

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 …

Member Avatar for N3oblaster
0
235

The End.