5,346 Posted Topics
Re: You have to use[URL="http://msdn.microsoft.com/en-us/library/system.io.ports.serialport.aspx"] SerialPort[/URL] class and its methods. | |
Re: Use [B]and[/B] operator. [CODE]com = new OleDbCommand("select Accesstype from FTPSitesAuthorisation WHERE SiteName = @site_name and [UserName]=@user_name", conn); com.Parameters.AddWithValue("@site_name","site_name_here"); com.Parameters.AddWithValue("@user_name","user_ame_here"); [/CODE] | |
Re: [b]>so can you provide an example?[/b] You can use HttpWebRequest class or WebBrowser control. | |
Re: No! you can't use <%= %> (expression) with server controls. Use Binding expression: Markup: [CODE]<asp:Label ID="Label1" runat="server" Text='<%# Session["value"] %>' />[/CODE] Code-behind [CODE] protected void Page_Load(object sender, EventArgs e) { Session["value"] = 100; Label1.DataBind(); }[/CODE] | |
Re: Use Linq to Xml (import the System.Xml.Linq namespace). That way you can easily read/write XML document. To read Xml document. [CODE]doc = XDocument.Load(file); string server = doc.Root.Element("Parameters").Element("servername").Value; string username = doc.Root.Element("Parameters").Element("username").Value; Console.WriteLine(server); Console.WriteLine(username); [/CODE] To create Xml document. [CODE]XDocument doc = new XDocument(); XElement root=new XElement("Configuration"); XElement param=new XElement("Parameters"); param.Add(new … | |
Re: Add three buttons onto the webpage. Name of three buttons are Button1, Button2, Button3. After that, place a Multiview onto the page and Drop three View controls inside a MultiView. Write following code in Button's click event for Button1_Click [CODE=ASP.NET] MultiView1.ActiveViewIndex=0 [/CODE] for Button2_Click [CODE=ASP.NET] MultiView1.ActiveViewIndex=1 [/CODE] for Button3_Click [CODE=ASP.NET] … | |
Re: Improper syntax. [code] String query = @"Insert INTO ImagesStore (OriginalPath,ImageDarta) Values ('" + txtImagePath.Text + "','" + pictureBox1.ImageLocation + "')"; [/code] | |
Re: [b]>Please help me how I create the login form using c# in asp.net [/b] Have a look at MSDN article - [URL="http://msdn.microsoft.com/en-us/library/ms178331.aspx"]How to create a login page?[/URL] | |
Re: You can't request Master page directly. For more info visit the [URL="http://msdn.microsoft.com/en-us/library/wtxbf3hh.aspx"]MSDN[/URL] pages. | |
Re: Hi Venu, This is for you. [URL="http://www.codeproject.com/KB/WPF/WPFDataGrid.aspx"]http://www.codeproject.com/KB/WPF/WPFDataGrid.aspx[/URL] | |
Re: You may start to learn reporting tools - Crystal Report or Microsoft Report if you want to print result from database or follow the @Danny's (ddanbe) post. | |
Re: Download [URL="http://www.highcharts.com/download"]HighChart[/URL] and you will find number of samples. | |
Re: You haven't specified that what types of pages/files you want to add dynamically. However you may use System.IO classes to create a file/page. For instance, [CODE]string filePath=MapPath("~/file.html"); string htmlText="<!DOCTYPE html> <h1>Hello World</h1>"; System.IO.File.WriteAllText(filePath,htmlText); [/CODE] | |
Re: Don't use hard-coded SQL string and no-need to add/replace NewLine characters in text which is input via Multi-line textbox. >@kenth21v : So if I retrieve the data it displays a single lined text. May be you are trying to display text in Single line textbox. Try using Label or Multilie … | |
Re: Actually you have to rephrase your question. If you are talking about GridView then you need to set EditIndex and re-bind that GridView. | |
Re: You must have to learn ADO.NET Oledb provider classes. To integrate Ms-Access database operations in your application, you need to use OleDbConnection, OledbCommand, OleDbDataReader and optionally OleDbDataAdapter and DataSet/DataTable. Take a look at MSDN articles. | |
Re: [b]>I'm stuck regarding to grab connection from app.config file[/b] 1. Add the reference of System.Configuration.dll assembly and Import [b]System.Configuration[/b] namespace. 2. Use following code, [code] ... str=ConfigurationManager.ConnectionStrings("CnStr").ConnectionString ... [/code] | |
Re: There are dozens of announcements and countless features on windows 8 developer preview. 1. [URL="http://www.buildwindows.com/"]Keynote[/URL]. 2. Features of Windows :[URL="http://windows8center.com/"] Metro UI.[/URL] 3. [URL="http://www.windows8newfeatures.com/"]Windows 8 features[/URL]. 4. [URL="http://www.foxnews.com/scitech/2011/09/14/windows-8-developer-preview-hands-on-inside-all-new-features/"]Windows 8 Developer Preview Hands-on: Inside All the New Features[/URL] PS: I'm planning to download and install - Windows Developer Preview with developer … | |
Re: Your process is the one that uses file, you need to set image to null use something like this, [code] using(var img = Image.FromFile(filename).GetThumbnailImage(GetWitdth(filename, GetHeight(filename, 200)), GetfHeight(filename, 200), null, new IntPtr())) pictureBox1.Image = img; [/code] | |
Re: [b]>I dont know how to filter the datagridview with the 2 datetimepicker control [/b] You can filter the datasource easily using DataView. Create an instance of System.Data.DataView [code] Dim dt as new DataTable // You have to populate the datatable instance Dim dv as DataView =new DataView(dt) DataGridView1.DataSource=dv [/code] Filter … | |
![]() | Re: As an aside, one thing worth noting is that you must have to avoid Java code in JSP-Files. Your Java code must be placed into [URL="http://docs.oracle.com/javaee/6/tutorial/doc/bnafd.html"]Servlet[/URL] and other model classes to handle and process the request. In JSP files, you may use [URL="http://docs.oracle.com/javaee/6/tutorial/doc/gjddd.html"]EL[/URL] (Expression Language) and [URL="http://jstl.java.net/"]JSTL [/URL]. The standard … |
Re: This is not a problem you can still run your page. However you can use, [CODE]<td class='<%=if(dx("row_no")=1,"head","grrhead2") %>'> [/CODE] | |
Re: Purchase a good book. I suggest [URL="http://www.amazon.com/Network-Programming-Microsoft-Windows-Professional/dp/0735605602"]Network Programming for Microsoft Windows[/URL] by Anthony Jones. It is a good book. | |
Re: Have a look at MSDN article - [URL="http://msdn.microsoft.com/en-us/library/aa701256(office.11).aspx"]Integrating Excel and Word with ASP.NET 2.0 Web Sites[/URL] | |
Re: Separate the index for each column. I guess the [I]ID[/I] and [I]JobID[/I] are two separate indexes and don't use UINT column if a MEDIUMINT or smallint is large enough to hold the values you need to [URL="http://forge.mysql.com/wiki/Top10SQLPerformanceTips"]store[/URL]. You can use [URL="http://dev.mysql.com/doc/refman/5.0/en/explain.html"]EXPLAIN[/URL] for any slow running query, always use explain to … | |
Re: In .net framework, [URL="http://msdn.microsoft.com/en-us/library/h43ks021(v=VS.100).aspx"]ADO.NET[/URL] class library's classes (provider classes) are used. To use these classes you may choose [URL="http://www.w3schools.com/aspnet/aspnet_dbconnection.asp"]VB.NET or C# language[/URL]. | |
Re: Use[B] Decimal.TryParse()[/B] method to parse the input. Use parameterized insert/update query instead of hard-coded sql string. | |
Re: You have to use Parameters (prepare). [CODE] conn = new SqlConnection("Data Source=ACCSOFTA005\\ACCSOFTA005G;Initial Catalog=webstoreDB;User ID=sa;Password=sa"); string sql="INSERT INTO Picture (PictureBinary,MimeType,IsNew) Values (@PictureBinary,@MimeType,@IsNew)"; SqlCommand cmd = new SqlCommand(sql, conn); cmd.Parameters.Add("@PictureBinary",SqlDbType.Image,pict.Length).Value=pict; cmd.Parameters.Add("@MimeType",SqlDbType.VarChar,50).Value=pname; cmd.Parameters.Add("@IsNew",SqlDbType.Int).Value=1; conn.Open(); cmd.ExecuteNonQuery(); conn.Close();[/CODE] | |
Re: May be you have to create an object of [B]Context [/B]for each unit of work. | |
Re: Yes! you need to register [URL="http://msdn.microsoft.com/en-us/library/k6h9cz8h.aspx"]ASP.NET IIS Registration Tool (Aspnet_regiis.exe)[/URL] with .net framework 4 | |
Re: I think you are aware of ASP.NET page life cycle. The Page and all objects (controls and other) will be created each time whenever a page is requested. So you need to use the state management - session to persist the DataTable/DataSet instance. In page_load handler [CODE] if(!IsPostBack) { DataTable … | |
Re: Use jQuery or JavaScript code. | |
Re: You have to use [URL="http://msdn.microsoft.com/en-us/library/system.net.webclient(v=vs.80).aspx"]WebClient [/URL]class method to download a file and also submit a form. | |
Re: [b]>i have already created an interface for it but no codes yet. [/b] Have a look at this thread - [url]http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/a9226072-e89a-49a5-93b3-05614f335d4c[/url] | |
Re: Method [B]GetElementsByTagName[/B] return an object of NodeList. [code] XmlNodeList nodelist= lblDocument.GetElementsByTagName("btn"); if (nodelist.Count != 0) SaveBtn.Text = nodelist.Item(0).InnerText; [/code] | |
Re: [I]Never[/I] use hard-coded sql string. Use the parameterized query. [code] cmd = new SqlCommand("update History set [History ID]=@historyid,[User ID]=@userid, [Project ID]=@projectid, [Project Start Date]=@startdate,[Task Name]=@taskname,[Completion Date]=@compdate where [History ID]= @hid", con); cmd.Parameters.AddWithValue("@historyid",t1.Text); con.Open(); cmd.ExecuteNonQuery(); .... [/code] | |
Re: First, search a row using Select method of DataTable. [code=vb.net] Dim r() As DataRow r = ds.Tables("Database").Select("ID=" & ddlName.SelectedValue) If r.Length <> 0 Then r(0).Delete() End If [/code] Full code. [code=vb.net] Imports System.Data Imports System.Data.OleDb Public Class Delete Dim inc, MaxRows As Integer Dim con As New OleDb.OleDbConnection Dim ds … | |
Re: No need to replace backslashes. For string literal we need to add \\ (backslashes). However you can use [B]String.Replace()[/B] method. | |
Re: You may use RichTextBox control that open [B]rtf[/B] word document or take a look at - [URL="http://support.microsoft.com/kb/304662/"]How to use the WebBrowser control to open Office documents in Visual C# 2005 or in Visual C# .NET[/URL] | |
Re: @morfious90 Please provide evidence of having done some work yourself if posting questions [URL="http://www.daniweb.com/forums/faq.php?faq=daniweb_policies"]from school or work assignments.[/URL] Similar thread : [url]http://answers.yahoo.com/question/index?qid=20110830135629AADCKGi[/url] | |
Re: Open the Server Explorer, add new oracle database connection, select the newly added connection from server explorer and get the connection string from the property windows. | |
Re: [URL="http://20.targetprocess.com/2006/10/hotkeys-binding-in-c-windows.html"]Hotkeys Binding in C# Windows Application[/URL] [QUOTE]SUMMARY: The problem is that C# does not have solution to bind hotkey through its API. Quick search in Internet allowed creating basic solution. Fist it is need to import two Win API functions to register/unregister Hotkeys in System.[/QUOTE] | |
Re: If your application type is [B]console [/B]then you have to use [I]Console.WriteLine()[/I] method. If an app is winform then use UI elements (ListBox). | |
Re: Use [B]char [/B]type method. 1. char.IsDigit 2. char.isLower and many more. | |
Re: Don't wait, just start your work. Learn SQL queries and run them via ADO.NET class library. | |
Re: See, [code] string filename="test.zip"; string path=MapPath("~/soft/" + filename); byte []bts=System.IO.File.ReadAllBytes(path); Response.Clear(); Response.ClearHeader(); Response.AddHeader("Content-Type","Application/octet-stream") Response.AddHeader("Content-Length",bts.Length.ToString()); Response.AddHeader("Content-Disposition","attachment; filename=" + filename); Response.BinaryWrite(bts); Response.Flush(); Response.End(); [/code] | |
Re: Try, [CODE]no=2 str=no.ToString("D2")[/CODE] ![]() | |
Re: Assign the special value [icode]null[/icode] to the reference variable. For more info - [URL="http://download.oracle.com/javase/tutorial/java/javaOO/usingobject.html"]tutorial.[/URL] [code] var=null; [/code] |
The End.