2,245 Posted Topics
Re: Why not have SQL Server generate the auto increment number for you? Create a table with an identity column: [code=sql] Create Table Tbl ( ID int identity(1000, 1) PRIMARY KEY, NameFirst varchar(50), NameLast varchar(50) ) [/code] Then insert data: [code=sql] Insert Into Tbl (NameFirst, NameLast) Values ('Scott', 'Knake') Select Cast(SCOPE_IDENTITY() … | |
Re: You can use logic like this to indicate the position of invalid emails. You didn't say VB/C# so I assumed C#: [code=c#] private void button3_Click(object sender, EventArgs e) { string input = @"a@b.com, a@c.com, ffff23805789232(*@#(*@#&)(*, a@d.com, e@f.com"; System.Net.Mail.MailAddress[] addrs = GetEmails(input); if (addrs.Length == 0) { //No emails were entered. … | |
Re: What connection error are you receiving? | |
Re: Here is a code example what MeSampath suggested: [code] Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click 'Read an image Using conn As New System.Data.SqlClient.SqlConnection("Data Source=apex2006sql;Initial Catalog=Scott;Integrated Security=True;") conn.Open() Using cmd As New SqlClient.SqlCommand("Select Top 1 Name, CreateDate, Picture From Picture", conn) Using dr As SqlClient.SqlDataReader … | |
Re: I don't understand what you are asking. Could you explain your situation a little more? | |
Re: Check your IP address against known lists on the internet: [url]http://www.mxtoolbox.com/blacklists.aspx[/url] [url]http://www.spamhaus.org/sbl/[/url] [url]http://www.blacklistalert.org/[/url] If you have a dynamic IP from your ISP sometimes you will get an ip address that caused abuse by another user and you have to request getting your address removed. | |
Re: [code] private void frmImage_Load(object sender, EventArgs e) { new Action(CreateStuff).BeginInvoke(null, null); } private void CreateStuff() { DateTime dtStart = System.Diagnostics.Process.GetCurrentProcess().StartTime; while (DateTime.Now.Subtract(dtStart).TotalSeconds < 10) //10s System.Threading.Thread.Sleep(10); TextBox tb = null; this.Invoke(new MethodInvoker( delegate() { tb = new TextBox(); tb.Location = new Point(0, 0); tb.Text = "abc123"; tb.Name = "textbox12345"; this.Controls.Add(tb); … | |
Re: Why don't you write an XML serialization method yourself? The [icode]DataTable[/icode] and [icode]DataSet[/icode] xml serializations can add a lot of other stuff to the XML file. You can also create your columns like this: [code] DataTable dtBeer = new DataTable(); dtBeer.TableName = "Beer"; //Very important to set the table name … | |
Re: [B]>> is there a way to check if the value in the textboxes match the field in the database so it does not overwrite the field if it has not been changed.[/B] It is very redundant so Microsoft included code generators for DALs (data access layers). You can create a … | |
Re: My results: [quote] You are Superman You are mild-mannered, good, strong and you love to help others. [/quote] | |
Re: It is and conceptually it is identical to paging. In web apps you want to retrieve rows 0-9, 10-19, 20-29, etc. I normally hate to refer people to google for an answer but there are a lot of ways to go about doing this and you should select the one … | |
Re: The [URL="http://technet.microsoft.com/en-us/library/cc723564.aspx"]PATH[/URL] and [URL="http://technet.microsoft.com/en-us/library/cc723564.aspx"]PATHEXT[/URL] environment settings are used to locate applications that start. So for your example, notepad.exe, there are two conditions that must be met for the program to execute: 1) The program is in the current working directory (cwd) or contained in [icode]%PATH%[/icode] 2) The program extension was … | |
Re: Can you explain what you are really trying to do here? What type of file is this? Most file types don't do you any good unless you have the entire file downloaded, the exceptions being multimedia. However multimedia files are usually compressed for distribution so in this case I don't … | |
Re: What do you mean by it wont save data? Does the code throw an exception or does it not error, but you don't see data? | |
Re: [code] private static Bitmap GetScreenShot(Control ctrl) { Bitmap result = new Bitmap(ctrl.Width, ctrl.Height, PixelFormat.Format32bppArgb); using (Graphics gfx = Graphics.FromImage(result)) { Point pt = ctrl.PointToScreen(new Point(0, 0)); gfx.CopyFromScreen(pt.X, pt.Y, 0, 0, result.Size, CopyPixelOperation.SourceCopy); } return result; } private void button7_Click(object sender, EventArgs e) { Bitmap panelScreenshot = GetScreenShot(panel1); pictureBox1.Image = panelScreenshot; … | |
Re: What version of SQL Server are you running? DTS was available in MSSQL 2000 but replaced with SQL Server Integration Services in MSSQL 2005 and later. You may consider reading up on SSIS. If you are using MSSQL 2000 then you can create a DTS package for the import and … | |
Re: [QUOTE=avirag;1079349]Well you can try this: [CODE] <html> <Head> <body bgcolor="Green"> <img src="http://www.image path" alt="" /> </body> </head> </html> [/CODE] Hope it helps.......:)[/QUOTE] I want to point out one thing here -- With HTML enriched emails you have to use pure HTML and not the newer XHTML. When I was first … | |
Re: Yeah there is all sorts of ways you just need to wire one up. Why don't you use a C# application to create a WebRequest and hit your PHP page that will begin compressing the file. This also eliminates adding more code paths to your project since you'll be using … | |
Re: You need to clean up the SQL classes you're instantiating as well. They implement [icode]IDisposable[/icode] and should be disposed of: [code] using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Data.SqlClient; namespace daniweb { public partial class frmSqlSearch : Form { public … | |
Re: I would listen to rch1231. There is also another utility called rsync you can get for Windows which has extensive copy/backup options. This [B]may[/B] be possible to do in a batch script but you will need to run down those guys who used to make batch files for as400 mainframes … | |
Re: [code] Insert Into DB1..Table(Col1, Col2) Select Col1, Col2 From DB2..Table [/code] | |
Re: If you're updating a GUI then that must take place on the main thread. I think this example is something like you're wanting to do: [code] using System; using System.Collections.Generic; using System.Runtime.Remoting.Messaging; using System.Threading; using System.Windows.Forms; namespace daniweb { public partial class frmDoubleDraw : Form { public frmDoubleDraw() { InitializeComponent(); … | |
Re: By default routers don't forward multicast traffic I believe unless they are told to subscribe via [URL="http://en.wikipedia.org/wiki/Internet_Group_Management_Protocol"]IGMP[/URL]. What type of edge routers are you running on both sides of the connection? You should consider running [URL="http://www.wireshark.org/"]Wireshark[/URL] on the side of the connection listening for data to see if you receive … | |
Re: With .NET you don't. Go ahead and give your deployment project a shot. It is also helpful because if you compile, say, a .NET 3.5 application and they don't have the framework installed then the application will just crash and you can't even show an error message box saying what … | |
Re: Why don't you just create a class in the designer and let the IDE/compiler handle it? I have never modified a project file like you're talking about | |
Re: Have you even [b]tried[/b] to [URL="http://lmgtfy.com/?q=camserver.dll"]google[/URL] that? [url]http://www.codeproject.com/KB/cpp/webcamcsharp.aspx[/url] | |
Re: Extract your embedded resources to a temp directory and point the web browser to the temp dir: [code] private void button3_Click(object sender, EventArgs e) { string tempDir = System.IO.Path.Combine(System.IO.Path.GetTempPath(), Guid.NewGuid().ToString()); System.IO.Directory.CreateDirectory(tempDir); //Extract your resources --- dont forget to delete the files when you are done! } [/code] | |
Re: I will post the code for creating an empty table .. but how is that going to help with your problem? [code] /// <summary> /// Builds a connection string /// </summary> /// <param name="server"></param> /// <param name="database"></param> /// <returns></returns> internal static string BuildSqlNativeConnStr(string server, string database) { return string.Format("Data Source={0};Initial … | |
Re: [QUOTE=zachattack05;1070705]Quick question...what if the number of strings is unknown, or is dynamic? Or in a situation like that would it be better to use a database?[/QUOTE] As a general answer to your question I would say no. You can serialize an array or use a generic [icode]List<string>[/icode] and serialize that, … | |
Re: A local printer is plugged directly in to your PC (usually USB, LPT) while a network printer is available over TCP/IP. You can share local printers, buy a print server and have a true network printer if the unit doesn't come with a NIC, or the newer and more expensive … | |
Re: Post the code for your entire page. Please use code tags when posting code on daniweb: [noparse] [code] ...code here... [/code] [/noparse] Also use the debugger and evaluate [ICODE]IsPostback[/ICODE] and see how many times the code is run. | |
Re: Have you tried executing the application outside of the debugger? If that fixes it (I doubt it) then shut the visual studio hosting process off for the project. The hosting process tends to screw up more than it helps. As for the JxtaNET.dll you can use RedGate's reflector to decompile … | |
Re: You can also take a look at [icode]char.IsNumber()[/icode]: [code] private void textBox1_KeyPress(object sender, KeyPressEventArgs e) { if (!char.IsNumber(e.KeyChar)) e.Handled = true; } [/code] There is still a few more problems though -- You can right click on the text box and select "paste" and that will allow pasting letters in … | |
Re: That depends a lot on how you're painting the rectangle. Here is a sort-of-generic way to measure given a control. [code] using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace daniweb { public partial class frmDrawText : Form { public frmDrawText() { … | |
Re: That industry is in the toilet ... I hope you don't expect to get paid! :P As far as what technology to use that depends on your customers demand and what you want the application to use. Also the datastructure depends on the database you want to use. IE is … | |
Re: Can you upload a sample project? I can't compile the code -- I'm missing references to the controls. You should also use [icode]using()[/icode] blocks to ensure instances of IDisposable are cleaned up when they go out of scope. Also why don't you use the graphics provided in [icode]e.Graphics[/icode]? in the … | |
Re: That doesn't mean anything. Some routers are configured to respond to traceroute and others are configured to deny it. If the routers were down you would not get any responses past that router. In one of your traceroutes you have 3 hops that do not respond then it starts responding … | |
Re: [QUOTE=VernonDozier;1076399]As to the larger problem, you can only give rep to an individual once a day. If they made the up/down the same way, that might limit the havoc.[/QUOTE] That would effectively make votes the same as rep. I noticed she did put a 15second delay in there for casting … ![]() | |
Re: You need to add a reference to the SqlLite assembly in your project. Have you installed the SQLLite software? If so right click on the "References" folder in your solutions explorer and select "Add Reference". Browse to the assembly DLL and add the reference. | |
Re: It works for me except I had to add a call to sleep after [icode]SetForegroundWindow()[/icode]. Also try adding a call to [icode]SendKeys.Flush()[/icode] after you're done sending keystrokes: [code] SetForegroundWindow(wordHandle); System.Threading.Thread.Sleep(100); SendKeys.SendWait("111"); SendKeys.SendWait("*"); SendKeys.SendWait("11"); SendKeys.SendWait("="); SendKeys.Flush(); [/code] | |
Re: You could use a directory selector dialog to allow overriding of the my documents path. Once a user overrides it then you could save the value in your application's config file so you won't have to deal with the dialog again. You would have automation and portability. | |
Re: Yeah one is the setup.exe and <Name>.msi. The setup.exe is just a wrapper to call the MSI file. Some older versions of windows don't support MSI files for installing so you are given both versions. Just give out the MSI as most people will be able to install it nowdays. | |
Re: You're probably pissing the FTP server off since you appear to be hammering it with connections. You should re-use an FTP connection to send file after file on the same connection, meaning you should open the connection -- send file 1 -- send file 2 -- send file 3 -- … | |
Re: What errors are you getting? What database are you using? Usually encrypting a string results in a longer string than the original input data so you may not have the columns defined wide enough in your database. | |
Re: Please use code tags when posting code on daniweb, and post the RAW sql -- not a huge concatenated string from VB: The problem is that you forgot an `'` in your query on the line for July: SELECT qry_close_month.Item_code, T_ITEM.item_name, Sum(IIf(qry_close_month.Bulan='January',qry_close_month.Stock,0)) AS Jan, Sum(IIf(qry_close_month.Bulan='February',qry_close_month.Stock,0)) AS Feb, Sum(IIf(qry_close_month.Bulan='March',qry_close_month.Stock,0)) AS Mar, … | |
Re: [B]>> - so in c# is 'this' the same as 'self' in python? 'self' meaning that the next period and variable/function are part of the class?[/B] Yes. When you're dealing with derived classes "this.<name>" could also point to a member in the base class if you did not override it … | |
Re: That is a tough one. Run the query both ways and take a look at the execution plan and see what indicators it gives you. You can include the actual and estimated plan using SQL Server Management Studio. | |
Re: [B]>> 1) Are "plug-ins" a common thing for applications to support? As in..."copy this .dll (or whatever) to this folder and bam! you get more features!"[/B] That really depends on the type of application. Some applications also offer plugins but only from the software vendors. ie an accounting software package … | |
Re: I would use UDP over TCP if you're streaming the data, but not if you're transferring a file. UDP is a stateless method of sending data and does not validate data integrity, which is analagous to how the radio and telephones work. If the packet is lost you will not … | |
Re: Is using the standard CTRL+C an option? You could flag while you were in the middle of a loop and break out of the loop instead of killing the console application. I think you have to implement a considerable amount of code to start handling intercepts for CTRL+<key> in console … |
The End.