|
what sql query will be used to display last 4 or 5 records from a table, i want to display the last entered records not all
|
|
|
|
|
if using sqlserver or access just
select top 5 * from..... order by ID
if using mysql use:
select * from ... order by ID limit 5
assuming you have an ID autoincrement column
(actually it's always better to explicitly state the cilumns you want rather than use * ....)
|
|
|
|
|
hi all,
I have Application on my local machine, and I want to tranfer it to normal windows 2003 server for public use. What I have to do? Just Drag'n'Drop?
Thanks
|
|
|
|
|
totocaster wrote: Just Drag'n'Drop
Or XCopy .
And webshare the folder over there. It is so easy as telling 1, 2, 3...
|
|
|
|
|
Hello Friends,
I am new to .Net world and also confused.
I want to get data from N number of web sites. I got the source code of the web page from where the data is avbl. For that Thanks to Shrinivas and Dan. Now, the source code can be saved to a file. I got to search data from the source code and save it in a Access or Excel file. The prg via which source code is avbl that is in ASP. My query is how to achieve the whole task.
I will store all URL's in an array/collection, get source code of one by one, retrieve data, save it & proceed to other url. That's how the logical loop will be. But in Retrieve Data, I cannot store the data in a String & work over it - Substr, index, etc. If I read from saved file, using which method will be beneficial - FileIOStream, StringReader or some thing else.
Where sould I write code for this all - Scriplets <% %>?
I alos got to save data, after collectiong all data in a Collection, I need to write it in Excel/access file which needs data connectivity.
Based on above queries, I would like to know how to achieve it, additionally should I do it in ASP or can it be done in VB.Net - then can I also get source code via VB.NET. I think VB will be much better for playing with other all things like Collections, SEarching etc.
Please guide me accordingly. I need to develop it at the earliest.
Thanks
Terry
-- modified at 23:35 Tuesday 24th July, 2007
|
|
|
|
|
Trupti Mehta wrote: as I know all the languages to some extend
Jack of all trades is master of none.
|
|
|
|
|
Hi
I have had to move my project onto another machine
I have managed to backup my application and database and I have downloaded the latest .NET connector
but i keep getting the following error message every time i try to open my database connection
ex.Message "Unable to connect to any of the specified MySQL hosts."
Doesn't make sense
as its all exactly the same
cheers
botindie
|
|
|
|
|
So the MySQL db has also been moved and configured exactly the same ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Yes I ahve backed it up and restored it in mySQL on this machine
|
|
|
|
|
The only notable difference is my laptop was runnin on microsoft xp pro and this runs on microsoft xp media centre
|
|
|
|
|
Hi All,
I am printing a gridview using Window.print(). Some Grids are very wide (contains soo many columns) Is there a way to control the printing? Thanks
|
|
|
|
|
|
Hello Everybody
I m new to use Infragistic NetAdvantage, is anyone here who have used this. i just wana ask how to start with this. Thanx in advance
Regards, Qaiser Nadeem
|
|
|
|
|
When you installed NetAdvantage, a number of samples were installed. This[^] might help as well.
When you have questions about a component, it is generally best to go to the component manufacturers forums first - they are the best suited to answer your questions.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
What is error in this code? When I click btnsave button, though it is giving the message 'Project has been started', the data is not getting updated.
Protected Sub btnsave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsave.Click
start(txtpno.Text.Trim())
End Sub
Function start(ByVal pno As String)
Dim sqlstr1 As String
Dim dr As SqlClient.SqlDataReader
sqlstr1 = "update D_task_det set str_date='" & Now.Date() & "',status='In_Progress' where pno='" & pno & "'and flag='0'and task='" & lbltask.Text.Trim() & "' and status='Pending'"
Try
If dbconn.State <> ConnectionState.Open Then
dbconn.Open()
End If
Dim sqlcomm1 As New SqlClient.SqlCommand(sqlstr1, dbconn)
sqlcomm1.ExecuteNonQuery()
dbconn.Close()
lblmsg.ForeColor = Drawing.Color.DarkGreen
lblmsg.Text = "Project has been started."
tbentervalue.Visible = False
tbtelescopic.Visible = False
tbpto.Visible = False
tbsystem.Visible = False
tbaccessories.Visible = False
tbvalves.Visible = False
tbpumps.Visible = False
tbtipper.Visible = False
tbentervalue.Visible = False
tboth.Visible = False
lbltask.Visible = False
' clear()
newproject()
Catch ex As Exception
lblmsg.Text = "Transaction failed." ' + ex.ToString()
dbconn.Close()
End Try
End Function
Chaitra N
|
|
|
|
|
You should read up on SQL injection attacks.
Nowhere does your code check to see if the update command actually updated any records, I recommend stepping through to see what the sQL is, and running the same SQL in query analyser, to see if it actually finds any records to update.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
When I run the statement in query analyzer, it does work. And how to read up on SQL injection attacks
Chaitra N
|
|
|
|
|
Any Body can explain me the Web Farm Concepts and with examples.
Thanks in Adance.
VEERU
|
|
|
|
|
A web farm means lots of servers working together. I'm not sure how you hope for examples, it's a hardware concept. Obviously, code needs to be written so it supports it.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
In Grid view header i putted one checkbox and inside gridview also having checkbox and one button outside the grid.
when i click button it's give me dgridview header checkbox check or not.
but it's giving me null.
this code giving me null.
CheckBox chkAllDelete = (CheckBox)GridView1.HeaderRow.FindControl("chkAll");
when i m trying to find this control.i m getting null value.
my code:
This code in Html part
<asp:templatefield>
<headertemplate>
<itemtemplate>
<asp:checkbox id="chkSelect" runat="server">
var counter = 0;
var pattern = '^GridView1';
// Get the checkboxes inside the Gridview which is part of the template column
function GetChildCheckBoxCount()
{
var checkBoxCount = 0;
var elements = document.getElementsByTagName("INPUT");
for(i=0; i<elements.length;i++)
{
if(IsCheckBox(elements[i]) && IsMatch(elements[i].id)) checkBoxCount++;
}
return parseInt(checkBoxCount);
}
// A function that checks if the checkboxes are the one inside the GridView
function IsMatch(id)
{
var regularExpresssion = new RegExp(pattern);
if(id.match(regularExpresssion)) return true;
else return false;
}
function IsCheckBox(chk)
{
if(chk.type == 'checkbox') return true;
else return false;
}
function AttachListener()
{
var elements = document.getElementsByTagName("INPUT");
for(i=0; i< elements.length; i++)
{
if( IsCheckBox(elements[i]) && IsMatch(elements[i].id))
{
AddEvent(elements[i],'click',CheckChild);
}
}
}
function CheckChild(e)
{
var evt = e || window.event;
var obj = evt.target || evt.srcElement
if(obj.checked)
{
if(counter < GetChildCheckBoxCount())
{ counter++; }
}
else
{
if(counter > 0) { counter--; }
}
if(counter == GetChildCheckBoxCount())
{ document.getElementById("chkAll").checked = true; }
else if(counter < GetChildCheckBoxCount()) { document.getElementById("chkAll").checked = false; }
}
function AddEvent(obj, evType, fn)
{
if (obj.addEventListener)
{
obj.addEventListener(evType, fn, true);
return true;
}
else if (obj.attachEvent)
{
var r = obj.attachEvent("on"+evType, fn);
return r;
}
else
{
return false;
}
}
function Check(parentChk)
{
var elements = document.getElementsByTagName("INPUT");
for(i=0; i<elements.length;i++)
{
if(parentChk.checked == true)
{
if( IsCheckBox(elements[i]) && IsMatch(elements[i].id))
{
elements[i].checked = true;
}
}
else
{
elements[i].checked = false;
// reset the counter
counter = 0;
}
}
if(parentChk.checked == true)
{
counter = GetChildCheckBoxCount();
}
}
|
|
|
|
|
Since you are using asp.net why are you using input html controls for your checkboxes instead of asp.net checkbox server control?
Ben
|
|
|
|
|
What if any impact does folder structuring of a website have on SEO? Also the naming of the files. Is it better to have the pages as close to the root as possible or to have all the files named index.aspx and in a folder structure for example...
english -- uk -- advertisements -- index.aspx
english -- usa -- advertisements -- index.aspx
and
french -- uk -- advertisements -- index.aspx
french -- usa -- advertisements -- index.aspx
Does this type of structure actually help with SEO?
He who laughs last is a bit on the slow side
|
|
|
|
|
Hi,
The structure doesnt matter so much the key elements are:
1) Naming files as appropriately as possible. However overkill is actually a negative things.
2) Dont nest your files so much that they are excessively stacked. If you have files nested more that say 3 folders deep you may piss the search engine spiders off and the files wont get indexed.
3) Its more important to optimise your page content and meta tags than anything else.
munklefish
|
|
|
|
|
Hi All
I m using asp.net with vb.net. There s a DataGrid Control on my page, There is a column Customer Name who's Text is set as below.
in aspx page
<asp:Label ID="custnamelbl" runat="server" Text='<%# setcustomername(container.dataitem("order_id")) %>' ></asp:Label>
Look at its Text property how it is set.
And the code of setcustomername sub is as follow.
Function setcustomername(ByVal orderid As Integer) As String
SelectQuery = "SELECT customers.customer_id,customers.customer_type, customers.fname, customers.lname FROM customers INNER JOIN cust_order ON customers.customer_id=cust_order.customer_id WHERE cust_order.order_id=" & orderid & ""
selectcommand = New OleDbCommand(SelectQuery, Conn)
total = selectcommand.ExecuteReader()
While total.Read()
If Not total.IsDBNull(0) Then
cuid = total.getvalue(0)
End If
If Not total.IsDBNull(1) Then
cusType = total.getvalue(1)
End If
If Not total.IsDBNull(2) Then
first = total.getvalue(2)
End If
If Not total.IsDBNull(3) Then
last = total.getvalue(3)
End If
End While
If cusType = 1 Then
camp_name = ""
SelectQuery = "SELECT comp_name FROM biz_cust_extra WHERE customer_id=" & cuid & ";"
selectcommand = New OleDbCommand(SelectQuery, Conn)
total = selectcommand.ExecuteReader()
While total.Read()
If Not total.IsDBNull(0) Then
camp_name = total.getvalue(0)
Else
camp_name = ""
End If
End While
Return camp_name
Else
Return first & " " & last
End If
End Function
U can see that if customer is business customer then its company name will b displayed, if it is end user then its name will b displayed. Now the column will have either name or company name. I want to Sort this column when some one click on its header.
Can any one tell me how to do that. Its realy very urgent. Pls Help me.
thanks in Advance.
|
|
|
|
|
The gridview has built in support for sorting. Otherwise, you need to render headers that are clickable, and that change the SQL that's executed, so it sorts by the correct fields.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|