5,346 Posted Topics
Re: You may use System.IO.File.AppendText(...) Method. | |
Re: Welcome to @Daniweb. I didn't get your question. Do you want to get **Parts** (Day, Month etc from DateTime? DateTime date=DateTime.Now; Console.WriteLine(date.Day); Console.WriteLine(date.Month); | |
Re: [code] Private Sub DataGridView1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles DataGridView1.KeyDown If e.KeyCode = Keys.Enter Then e.Handled = True '<------ End If End Sub [/code] | |
Re: Use `System.Linq.Enumerable.Range(start,count)` method to sequence of `Integer` numbers. For example, ComboBox1.Items.AddRange(Enumerable.Range(1, 100).Cast(Of Object)().ToArray()) | |
Re: Add *blank (space)* between two verbs. Here is an issue: `TextBox1.Text + "and PIN="` Never use **hardcoded** sql string. Use **Parameterized** query to prevent SQL Injection. (Just Googled the `SQL Injection`). op = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source = F:\atm1.mdb") cd = New OleDbCommand("select * from Table1 where Accountnumber=@acno and PIN=@pin",op) cd.Parameters.AddWithValue("@acno", … | |
Re: You *must* have to post **relevant** code that you've written so far, name of Database product that you're using, and Stored-Proc desciption (name along with parameters type). Generally, *we* use ADO.NET core Provider API - Connection,Command,DataReader classes to execute Stored-procedures/functions/queries. | |
Re: You have to use `WebClient` class to request a URI/URL. using (WebClient client = new WebClient()) { byte []ar=client.DownloadData("http://webwebweb.com/work.php?worker=1&shop=52"); string str = System.Text.Encoding.UTF8.GetString(ar); } | |
Re: You're passing `productid` to `ProductLarge.aspx` as `QueryString` and rendering an *image* via handler so you need to request the `handler` with `productid` in `ProductLarge.aspx`. <asp:HyperLink ID="lnkImage" runat="server" ImageUrl='<%# Eval("productid","~/Handler.ashx?productid={0}") %>' NavigateUrl='<%# Eval("productid","ProductLarge.aspx?productid={0}")' /> and markup in `ProductLarge.aspx` should be, <img src='Handler.ashx?productid=<%=Request["productid"] %>' alt='Large Image' /> | |
Re: Have a look at this [URL="http://www.codeguru.com/forum/showthread.php?t=396032"]article.[/URL] | |
Re: Use parameterized SQL statements. sqlString ="INSERT INTO tbl_Booking ([Booking Date],[Check In Date],[Check Out Date],[Room No]) VALUES (@BookingDate,@InDate,@OutDate,@RoomNo)"; using(OleDbConnection cn=new OleDbConnection()) { using(OleDbCommand cmd=new OleDbCommand()) { cn.ConnectionString=@"connection_string_here"; cmd.Connection=cn; cmd.CommandText=sqlString; cmd.Parameters.AddWithValue("@BookingDate",BookingDate); ... cn.Open(); cmd.ExecuteNonQuery(); cn.Close(); } } | |
Re: Please do not resurrect old threads. If you have any questions please ask. .... You are welcome to start your own threads. Thread Closed. | |
Re: Yes, you can call Stored procedure via SqlDataSource. | |
Re: Edit your web.config with following content (Have a look at [MSDN Link](http://msdn.microsoft.com/en-us/library/e1f13641(v=vs.100).aspx) ) <system.web> <httpRuntime maxRequestLength="10240" executionTimeout="3600"/> </system.web> | |
Re: Use, `SELECT TOP 20 * FROM from CHAP1_quiz ORDER BY newid()` This SQL statement will fetch 20 rows (random order by NEWID()) from the database. Code block: using(SqlConnection connection=new SqlConnection(constr)) { string sql="SELECT TOP 20 * FROM from CHAP1_quiz ORDER BY newid()"; using(SqlDataAdpater adp=new SqlDataAdapter(sql,connection)) { DataTable dataTable=new DataTable(); adp.Fill(dataTable); … | |
Re: We are glad you got it helpful.Please do not resurrect old threads. [icode]If you have any questions please ask. You are welcome to start your own threads.[/icode] Please read the rules before posting again - [url]http://www.daniweb.com/forums/thread78223.html[/url] and [URL="http://www.daniweb.com/forums/faq.php?faq=daniweb_policies"]rules[/URL]. [B]Thread Locked.[/B] | |
Re: Change column type to BigInt. | |
Re: Read MSDN article - [URL="http://msdn.microsoft.com/en-us/library/26db8ysc(VS.85).aspx"]How to create and access usercontrol properties[/URL]? and an article of codeproject - [url]http://www.codeproject.com/KB/user-controls/DynamicLoadingUserControl.aspx[/url] | |
Re: Do not use report viewer. [code] .. TestReport rep = new TestReport(); rep.SetDataSource(ds); rep.PrintToPrinter(0, true, 0, 0); .. [/code] | |
Re: Never use *hard-coded* SQL string. You should learn the *Parameters*. string sql="INSERT INTO BASIC_INFO (sno,name,fathers_name,alias,age,education) VALUES (@sno,@name,@fathers_name,@alias,@age,@education)"; using(OleDbConnection cn=new OleDbConnection()) { using(OleDbCommand cmd=new OleDbCommand()) { cn.ConnectionString="Your connection String"; cmd.CommandText=sql; cmd.Connection=cn; cmd.Parameters.AddWithValue("@sno",0) cmd.Parameters.AddWithValue("@name",name.Text); ... cn.Open(); cmd.ExecuteNonQuery(); cn.Close(); } } | |
Re: [b]>No value given for one or more required parameters. [/b] Error says that the column name(s) or a table name in given query are not belongs to the table - Employee. Please open the .accdb and check/verify the name of columns/table. Second, try to use parametrized queries. | |
Re: Take a look at [url]http://translateth.is/[/url] | |
Re: Choose [B]ListView[/B] over [URL="http://forums.asp.net/t/1274913.aspx"]GridView[/URL]. Take a look at CodeProject article - [URL="http://www.codeproject.com/KB/webforms/addupdate.aspx"]ASP.NET GridView - Add a new record[/URL] | |
Re: [b]>How could I do a full reset of dataset or maybe the gridview ? [/b] [code] dataGridView1.DataSource = null; [/code] | |
Re: [b]>RDLC in .NET frmaework Date formatting [/b] [code] =iif(IsNothing(Fields!StartDate.Value),"02/12/2010", Format(Fields!StartDate.Value,"dd-MMM-yyyy") ) [/code] | |
Re: I'm glad you got it helpful. If you want to ask question, start your own thread. Thread Closed. | |
Re: You may choose other data controls like - DataList, Repeater, ListView and so on. If you don't want to use the data controls then you can iterate the result using loop and render it by wrapping html tags. Please post your [SSCCE](http://sscce.org/). | |
Re: How many FileUpload controls are there in your markup? If it is single then no need to add database code in a loop. Please post markup (.aspx). | |
Re: Add a new *expression* column to the DataTable. | |
Re: Handle the *Inserted* event and change mode of FormView by calling *FormView.ChangeMode()* method. | |
Re: You have to change/format the INSERT statement. sqlcon.Open(); SqlCommand sqlcmd = new SqlCommand("INSERT INTO TABLE1 (Name, Address, Email, Phone, Dob) VALUES (@Name, @Address, @Email, @Phone, @Dob)"; sqlcmd.Parameters.AddWithValue("@Name", nametbox.Text); sqlcmd.Parameters.AddWithValue("@Address", addtbox.Text); sqlcmd.Parameters.AddWithValue("@Email", mailtbox.Text); sqlcmd.Parameters.AddWithValue("@Phone", phonetbox.Text); sqlcmd.Parameters.AddWithValue("@Dob", dobtbox.Text); lbl.Visible = true; sqlcmd.ExecuteNonQuery(); sqlcon.Close(); | |
Re: Fluent C# is a *very* low quality book. Take a look at reviews: > [Jon skeet (Author of C# in Depth)](http://msmvps.com/blogs/jon_skeet/archive/2011/12/05/book-review-fluent-c-rebecca-riordan-sams.aspx) > I really don't like ranting. I don't like sounding mean - and I wanted to like this book. While I like C# 4.0 in a Nutshell and Essential … | |
Re: Put at least one space/whitespace between keywords/identifier in SELECT statement and never use hardcoded string. Have a look at : [CUST_NAME])VALUES('"+productname and INTO [PRODUCT_DETAILS]([PRODUCT_NAME] **Always use parameters**. using(OleDbConnection con=new OleDbConnection(cnStr)) { string sql="INSERT INTO [PRODUCT_DETAILS] ([PRODUCT_NAME],[CHALLAN_NO],[CHALLAN_DATE],[BILL_NO],[BILL_DATE],[CUST_NAME]) VALUES (@productName],@challanNo,@challanDate,@billNo,@billDate,@custName)"; using(OleDbCommand insert = new OleDbCommand(sql, con)) { insert.Parameters.AddWithValue("@productName",productname); //or insert.Parameters.Add("@productName",OleDbType.VarChar,30).Value=productname; insert.Parameters.Add("@challanNo",OleDbType.Integer).Value=challan_no; insert.Parameters.Add("@challanDate",OleDbType.DateTime).Value=challan_date; … | |
Re: You should try the JavaScript code. <asp:ListBox ID="ListBox1" runat="server" onchange="window.open(this.value);"> <asp:ListItem>file1.pdf</asp:ListItem> <asp:ListItem>file2.pdf</asp:ListItem> </asp:ListBox> | |
Re: Double thread - http://www.daniweb.com/web-development/aspnet/threads/426132/csv-file-to-database Read forum rule : [Do not post the same question multiple times](http://www.daniweb.com/community/rules) | |
Re: Remove single quotes around parameters. SqlCommand SQLINSERT =new SqlCommand(); SQLINSERT.CommandText = "insert into table_1 (ID,name,address,phone,city) values (@id,@name,@address,@phone,@city)" ; SQLINSERT.Connection=conn; SQLINSERT.Parameters.AddWithValue("@ID",Textbox1.Text.ToLower()); SQLINSERT.Parameters.AddWithValue("@name",Textbox1.Text.ToLower()); SQLINSERT.Parameters.AddWithValue("@address",Textbox1.Text.ToLower()); SQLINSERT.Parameters.AddWithValue("@phone",Textbox1.Text.ToLower()); SQLINSERT.Parameters.AddWithValue("@city",Textbox1.Text.ToLower()); SQLINSERT.ExecuteNonQuery(); | |
Re: You should have to use AJAX Extension - UpdatePanel control. For more info read MSDN pages about AJAX extension. | |
Re: Try, `Set Label1.Text=ECJ-00001` Add foll. code in click handle of button Dim prefix = fullString.Split("-")(0) Dim no As Integer = Integer.Parse(fullString.Split("-")(1)) no = no + 1 Dim str As New String("0"c, 5 - no.ToString().Length) fullString = prefix & "-" & str & no Label1.Text = fullString | |
Re: Post the String resource xml or double check "string" resource /res/values/string.xml named **hello**. <?xml version="1.0" encoding="utf-8"?> <resources> <string name="hello">Hello World, ActivitiesActivity!</string> </resources> | |
Re: Don't reinvent the wheel! Use [Html Agility Pack](http://htmlagilitypack.codeplex.com/) > This is an agile HTML parser that builds a read/write DOM and supports plain XPATH or XSLT (you actually don't HAVE to understand XPATH nor XSLT to use it, don't worry...). It is a .NET code library that allows you to … | |
Re: @gahhon - You must have to post the solution here so other members will benefit from your question/answer. | |
Re: I can't see any problem here becuase you've missed to post the [SSCCE.](http://sscce.org/). However double check the dataSource (Data base), code that populates the CrystalReportSource object and so on. | |
Re: It is impossible to say/guess something about your code. Please include [SSCCE](http://sscce.org/). | |
Re: > But in my code there is some problem.I can't find it. Does it throws an exception? if yes then post logcat here. Please take a look at tutorial by Lars Vogel - [Android SQLite Database and ContentProvider - Tutorial](http://www.vogella.com/articles/AndroidSQLite/article.html) | |
Re: There are number of methods/APIs to parse XML document in .net framework but I'd like to use & suggest Linq-Xml. Have a look at [SSCCE](http://sscce.org/): Dim file = "c:\folder\data.xml" Dim doc = XDocument.Load(file) Dim Result = From ele In doc.Root.Descendants("Artist") Select New With { .Name = ele.Element("Name").Value, .Age = ele.Element("Age").Value, … | |
Re: Wrap your data binding code in Page_Load event with IsPostBack property block. Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load IF If Not IsPostBack Then 'Code to populate the DropDownList End If End Sub Set `DropDownList.AutoPostBack=True` and handle the `SelectedIndexChanged event`. Protected Sub lslNames_SelectedIndexChanged(sender As Object, e As … | |
Re: Please add your [SSCCE](http://sscce.org/) (Code and description) here. Do you want to change the properties of HyperLink? | |
Re: Always try to write [SSCCE](http://sscce.org/) that way you will find your issue & solution too. Here is my SSCCE: SourcePage.aspx markup : Add a GridView1 and a Button1 <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"> <Columns> <asp:TemplateField> <ItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%# Eval("ID") %>'></asp:Label> <asp:CheckBox ID="CheckBox1" runat="server" /> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> <asp:Button … | |
Re: You need to specify the database product you've used in your program. If you've file system database (.mdb, .accdb, ms-sql .mdf) in your solution/project then set `Copy To Output Directory=Copy if Newer` to the property of database file. | |
Re: You may convert existing fields into `TemplateField` or add new TemplateField. The `TemplateField` provide flexible approach to add/enhance the markup and binding properties. | |
Re: It will be better that you should have to post working/non-working code. Please take a look at these threads/articles. 1. [Create Event Organizer using ASP.NET Calendar Control](http://www.ezzylearning.com/tutorial.aspx?tid=8610220) 2. [Customizing the ASP.NET Calendar Control](http://www.codeproject.com/Articles/229445/Customizing-the-ASP-NET-Calendar-Control) 2. [Cool Tricks With The ASP.net Calendar](http://weblogs.sqlteam.com/jhermiz/archive/2007/12/10/Cool-Tricks-With-The-ASP.net-Calendar.aspx) |
The End.