5,346 Posted Topics

Member Avatar for nuevoenjava

> I would like to know if trhere is a way to limit the results and then retrieving more after the user has scrolled down more. If you've Ms-Sql server database then you may fetch limited rows from the table. SELECT * FROM ( SELECT *, ROW_NUMBER() OVER (ORDER BY …

Member Avatar for kvprajapati
0
109
Member Avatar for valestrom

You should have to use System.Text.StringBuilder. StringBuilder sb=new StringBuilder(); while ((line = sr.ReadLine()) != null) { sb.Append(line); }

Member Avatar for Mitja Bonca
0
211
Member Avatar for coolbeanbob

Beacuse you've posted the cut & paste code so it is better for you to read this MSDN blog post - [Creating a Home Page View Using Razor Syntax](http://msdn.microsoft.com/en-us/vs2010trainingcourse_aspnetmvc3razor_topic2.aspx)

Member Avatar for kvprajapati
0
91
Member Avatar for hprem991

Always use the [JSTL](http://stackoverflow.com/q/3177733/142822) <c:forEach var="count" begin="0" end="5"> <div id="div_${count}"> </div> </c:forEach>

Member Avatar for kvprajapati
0
113
Member Avatar for Pricess

Always use the parameters. cmd=new SqlCommand() cmd.CommandText = " INSERT INTO tblVehicle (VehicleNo,vehicleModel,vehiclePlat,[Type of License],TotalOfDriver) VALUES (@VehicleNo,@vehicleModel,@vehiclePlat,@TypeofLicense,@TotalOfDriver)" cmd.Connection=con cmd.Parameters.Add("@VehicleNo",SqlDbType.VarChar,20).Value=TxtNo.Text cmd.Parameters.Add("@vehicleModel",SqlDbType.VarChar,20).Value=TxtModel.Text cmd.Parameters.Add("@vehiclePlat",SqlDbType.VarChar,20).Value=TxtPlat.Text cmd.Parameters.Add("@TypeofLicense",SqlDbType.VarChar,20).Value=CmbLicense.Text cmd.Parameters.Add("@TotalOfDriver",SqlDbType.VarChar,20).Value=CmbDriver.Text con.Open() cmd.ExecuteNonQuery() con.Close()

Member Avatar for Reverend Jim
0
144
Member Avatar for elidotnet

Use bb code tags. [noparse] [CODE=C#] ... ... [/CODE] [/noparse] Look at bin folder's database1.mdf.

Member Avatar for prathamesh3090
1
7K
Member Avatar for panpwintlay

Welcome iajm, I'm glad you found it useful. Have you noticed that the current thread is two years old? Please do not resurrect old/solved threads. If you want to ask question, start your own thread. Read before posting- [url]http://www.daniweb.com/forums/thread78223.html[/url]

Member Avatar for Momerath
-1
1K
Member Avatar for rb1234567

>using c# and clicking a calander which will go to a booking form from each day Handle the event of calendar and use page redirection method (Redirect or Transfer). >how to add database to this? Learn and use ADO.NET.

Member Avatar for LiDmX
0
219
Member Avatar for mani508

You need to retrieve the path of image from the database and assign or bind it to ImageUrl property of Image control.

Member Avatar for coder389
0
97
Member Avatar for GTTravis
Member Avatar for kvprajapati
0
54
Member Avatar for coder389

Please read the MSDN documentation about [Caching.](http://msdn.microsoft.com/en-us/library/xsbfdd8c(v=vs.100).aspx)

Member Avatar for kvprajapati
0
176
Member Avatar for john_beginner

Method [CODe=Java] Runtime.getRuntime().exec() [/CODE] requires an external command. CLS is internal dos command. To run internal command using exec() we have to use CMD (external) command. Try it at command prompt. [CODE] >cmd /? -- help >cmd /c cls [/CODE] [CODe=Java] // Will create a new process Process ps=Runtime.getRuntime().exec (new …

Member Avatar for stultuske
0
13K
Member Avatar for sam63

Welcome sgavriel. We appreciate your help. Have you ever noticed that the current thread is three years old? Please do not resurrect old threads. Take a look at forum[URL="http://www.daniweb.com/forums/faq.php?faq=daniweb_policies"]rules[/URL]. Thread Closed.

Member Avatar for MuhammadSaad
0
4K
Member Avatar for poojavb

Fetch the DateTime column value from the database, Cast it to DateTime type and assign this value to the DateTimePicker1.Value property. Something like this: IF reader.Read() Then DateTimePicker1.Value=reader.GetDateTime(0) End IF

Member Avatar for poojavb
-1
1K
Member Avatar for coder389

Try the [Directory.Delete(string path. bool recursive) ](http://msdn.microsoft.com/en-us/library/fxeahc5f.aspx)method.

Member Avatar for Mitja Bonca
0
231
Member Avatar for pitic

You can't save the reference of Page (Read the MSDN about asp.net page life cycle). You need to use Session/Cookie/ViewState (State Management) to persist the data.

Member Avatar for kvprajapati
0
231
Member Avatar for Ameer89

Wrap the page_load event code in `IsPostBack` block Protected Sub Page_Load(sender As Object, e As System.EventArgs) IF Not IsPostBack Then Dim cn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c: .... End IF End Sub

Member Avatar for JorgeM
0
196
Member Avatar for weeraa

Use DateTime.AddMonths, AddDays methods. Dim dt = #12/20/2010# dt = dt.AddMonths(1) dt = dt.AddDays(-(dt.Day - 1))

Member Avatar for poojavb
0
156
Member Avatar for lhsunshine

What will happen when a user type following in the TextBox: `hello' or '1'='1` One must have to avoid the [SQL Injection](http://en.wikipedia.org/wiki/SQL_injection) by creating stored procedure or parameterized query. string cnstr=ConfigurationManager.ConnectionStrings["RegConnectionString"] .ConnectionString; bool found=false; using(SqlConnection con = new SqlConnection(cnstr)) { string cmdStr = "Select username from Reg where Username = …

Member Avatar for kvprajapati
0
166
Member Avatar for ishlux

You need to set [B]path[/B] not a [B]classpath[/B] for javac (compiler) and java (launcher). [code] PATH=......;c:\Program Files\Java\Jdk1.7\Bin [/code]

Member Avatar for ramguru
0
96
Member Avatar for Farhad.idrees

Fill() method create an instance of DataTable and DataTable instance hold references of rows (fetched result). [code] int a=0; if(myDataSet.Tables[0].Rows.Count!=0) { a= (int) myDataSet.Tables[0].Rows[0][0]; //1st row and 1st column } [/code]

Member Avatar for vpsingh136
0
172
Member Avatar for sonia sardana

Enabled the ListView1.ShowItemToolTips = True. [CODE=VB.NET] ListView1.View = View.LargeIcon ListView1.ShowItemToolTips = True For lcount As Integer = 1 To 3 ListView1.Items.Add(lcount.ToString, lcount - 1).ToolTipText = "Item" & lcount Next [/CODE]

Member Avatar for scstetro
0
2K
Member Avatar for ghawanmeh

Firstly, you have to create the array and after that instantiate the LinkedList elements. Dim myarray(3) As LinkedList(Of String) For i As Integer = 0 To myarray.GetUpperBound(0) myarray(i) = New LinkedList(Of String) Next

Member Avatar for kvprajapati
0
103
Member Avatar for rushikesh jadha

The web-browser cannot execute the ASP.NET control markup & server side scripting code. ASP.NET is the web-technology to generate the dynamic content of HTML/CSS/JavaScript and it requires web-server along with application server to execute server side script (Code of VB.NET or C#).

Member Avatar for kvprajapati
0
77
Member Avatar for murnesty

You have to typecast it explicitly, checked { usTest = (UInt16)(Convert.ToUInt16(sTest) + usOne); usTest = (UInt16)(Convert.ToUInt16(sTest) + 1); usTest = (UInt16)(Convert.ToUInt16(sTest) + Convert.ToUInt16(1)); }

Member Avatar for Momerath
0
258
Member Avatar for Jake.20

You need to create the image handler. Have a look at Image [handler tutorial](http://www.codeproject.com/Articles/34084/Generic-Image-Handler-Using-IHttpHandler).

Member Avatar for kvprajapati
0
164
Member Avatar for anand01

Have a look at FAQ - [How to avoid Java Code in JSP-Files?](http://stackoverflow.com/questions/3177733/how-to-avoid-java-code-in-jsp-files)

Member Avatar for anand01
0
124
Member Avatar for Verygoodguy

Iterate the `GridView.Rows` collection, extract value from the specific cell using `Cells` collections, and convert/parse the extracted value to decimal/integer.

Member Avatar for kvprajapati
0
118
Member Avatar for mani508

You have to use FileUpload.PostedFile properties. int fileLen = FileUpload1.PostedFile.ContentLength; string contentType=FileUpload1.PostedFile.ContentType; ... if(fileLen>=1 && fileLen<=1024*1024) { // } if(contentType=="image/jpeg") { //code }

Member Avatar for mani508
0
331
Member Avatar for php_noob

Of course Yes! The [Model-View-Controller](http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller) is the design-pattern.

Member Avatar for kvprajapati
0
68
Member Avatar for infinitus

You have to parse the 'string' data to the appropriate simple type before the calculation. for instance, double no1=double.Parse(textboxnumber1.Text); double no2=double.Parse(Label1.Text); You may also use XXXXX.TryParse method. e.g double no1; double.TryParse(textboxnumber1.Text,out no1);

Member Avatar for ChrisHunter
0
207
Member Avatar for barriegrant1

You need to add the `Image` control into GridView's `TemplateField` or just use `ImageField`.

Member Avatar for kvprajapati
0
134
Member Avatar for vidyade

You may store the diff of two datetime object values using `TimeSpan` structure. `Timespan diff=end-start;`

Member Avatar for kvprajapati
0
65
Member Avatar for nickg21
Member Avatar for jijo cleetus
0
119
Member Avatar for paoi00

What about `rid(5`) at line #14? I think it should be `reader(5`). PS: Never use hard-coded SQL strings. Use parameters. Dim Sql = "SELECT * FROM Account where Username=@Username" Dim UserName As String = String.Empty Using con As New OleDbConnection("your_conn_str") Using Command As New OleDbCommand(Sql, con) Command.Parameters.Add("@Username", OleDbType.VarChar, 40).Value = …

Member Avatar for poojavb
0
246
Member Avatar for SukhyDean

Never use hard-coded sql strings. Always use Parameters. cmd.CommandText = "select * from exam where category=@category"; cmd.Parameters.AddWithValue("@category",Request.QueryString["cat"]);

Member Avatar for SukhyDean
0
225
Member Avatar for VRamone

You have to use `GDI API` to draw the text. Learn/use the classes from `System.Drawing` namespace. private void Form1_Load(object sender, EventArgs e) { this.Paint += (sa, ea) => { ea.Graphics.DrawString("Bold Text", new Font("Arial", 10f, FontStyle.Bold), Brushes.Black, new PointF(5, 5)); }; }

Member Avatar for skatamatic
0
909
Member Avatar for Verygoodguy

Please check the column/cell value. I think the 2nd cell has non-numeric. If the ID is at 1st cell then try, `Id = Convert.ToInt32(row.Cells[0].Text);` or change index of Cells to 1 if ID is at second cell and so on

Member Avatar for kvprajapati
0
291
Member Avatar for Aviplo

You need to save the connection strings under `<connectionString/>` section and read it using `System.Configuration.ConfigurationManager.ConnectionString["CnStr_Name"].ConnectionString`. <connectionStrings> <add name="CnStr" connectionString="............" providerName="System.Data.SqlClient"/> </connectionStrings>

Member Avatar for JorgeM
0
138
Member Avatar for Mitja Bonca

[b]>how to pass more values (to be shown one under another) in just one parameter.[/b] [code] cryRep.SetParameterValue("@data", new int[]{10,20,30,40}); [/code]

Member Avatar for darko444
0
3K
Member Avatar for P.manidas

Because VB.NET version 2005 and later version uses "Default Form Instance". ([URL="http://stackoverflow.com/questions/4698538/there-is-a-default-instance-of-form-in-vb-net-but-not-in-c-why"]here[/URL] is good discussion) It means the name of Form (or you can say class name) represents an instance (object reference) and of course the form inside you are working is also an instance of same form. In short …

Member Avatar for P.manidas
0
859
Member Avatar for chandnigandhi
Member Avatar for Bchandaria
0
90
Member Avatar for naveedqadri

>I have to creat a dynamic table through asp.net in database. That is bad design. You should try to consider the alternative of this design.

Member Avatar for naveedqadri
0
124
Member Avatar for semor7

Use GetBoolean() method of DataReader. [code] ... var1=daraRead.GetBoolean(1) ... [/code]

Member Avatar for Pgmer
0
117
Member Avatar for ayesha789

Take a look at code snippet, [code] Dim dt As New Data.DataTable dt.Columns.Add("Name") dt.Columns.Add("Status") dt.Rows.Add("A", "Paid") dt.Rows.Add("B", "Unpaid") DataGridView1.AutoGenerateColumns = False DataGridView1.DataSource = dt Dim Name As New DataGridViewTextBoxColumn Name.DataPropertyName = "Name" Dim Status As New DataGridViewComboBoxColumn Status.DataPropertyName = "Status" Status.Items.Add("Paid") Status.Items.Add("Unpaid") DataGridView1.Columns.Add(Name) DataGridView1.Columns.Add(Status) [/code]

Member Avatar for darthswift00
0
3K
Member Avatar for sphe_g

Welcome sphe_g. I appreciate your eagerness to learn Database programming. I suggest you to buy a [URL="http://www.amazon.com/dp/073562206X/?tag=stackoverfl08-20"]good[/URL] book and also visit MSDN online [URL="http://msdn.microsoft.com/en-us/data/aa937722.aspx"]pages[/URL].

Member Avatar for lansky
0
1K
Member Avatar for JJCollins

DateTime formats: 1. [url]http://msdn.microsoft.com/en-us/library/system.globalization.datetimeformatinfo.aspx[/url] 2. [url]http://authors.aspalliance.com/aspxtreme/sys/demos/datetimeformats.aspx[/url]

Member Avatar for Wel Da gr8
0
2K
Member Avatar for nice_candy

The ASP.NET can remove data from the cache when: 1. Memory on server is low 2. Cache is expired etc. You must have to use [I][URL="http://msdn.microsoft.com/en-us/library/aa478965.aspx"]Cache Early; Cache Often[/URL][/I] technique to avoid such problems. [CODE]if(Cache["key"]==null){ //create cache entry Cache["key"]=value; } ....[/CODE]

Member Avatar for kvprajapati
0
69
Member Avatar for f.sh

You should have to create public properties in User control. For instance, [CODE]public String Name { get{ return txtName.Text;} set { txtName=value;} } [/CODE]

Member Avatar for f.sh
0
1K
Member Avatar for kshahnazari

You need to extends the Button class. [CODE]public class NewButton : Button { public int X {get;set;} public int Y {get;set;} }[/CODE]

Member Avatar for kvprajapati
0
75

The End.