|
It's new to me that this approach fails with Firefox
I'll have to check this because this is no good news for my applications!
Thanks for the hint.
-^-^-^-^-^-
no risk no funk ................... please vote ------>
|
|
|
|
|
I want the date format to be in this way like 15-jun-2005 using c# dot net
Regards,
Magi
|
|
|
|
|
DateformatFrom = datevalue.ToString("dd-MMM-yy hh:mm:ss");
you can convert the date into the format which ever you want.
I have shown you the one of the way to do that
Regards
Bharath.S Ron
|
|
|
|
|
get it Date format
---------------------------------------------------
|
|
|
|
|
Please do not cross post!
-^-^-^-^-^-
no risk no funk ................... please vote ------>
|
|
|
|
|
Can i write Multiple Select Statements in DataAdapter .
If it is Possible means How to write ?
I have written like this but it is throwing the error.
DataAdapter=new OleDbDataAdapter("select * from Table1;select * from Table2",connection);
VanithaVasu
|
|
|
|
|
No u canot write like this.. u can use join querry
Sarith...
|
|
|
|
|
VanithaVasu wrote: Can i write Multiple Select Statements in DataAdapter .
Yes you can. When you fill dataset, it will contain two datatables. But instead of separating multiple queries with ; symbol, it's better to go for store procedure's.
VanithaVasu wrote: I have written like this but it is throwing the error.
DataAdapter=new OleDbDataAdapter("select * from Table1;select * from Table2",connection);
What's the error it's throwing ?
|
|
|
|
|
The Error is : Characters found after end of SQL statement.
I want to the two tables separately in my dataset.
How to do so?
VanithaVasu
|
|
|
|
|
What is it that you are after?
If you want more than two select statements in the table use a join.
If you want different select statements for different tables or adapters,
use different querystrings...
I think for ur case u need :
DataTable dt1=new DataTable();
DataTable dt2=new DataTable();
dt1="first sql select query result";
dt2="second sql select query result";
dataset ds=new dataset();
ds.Tables.Add(dt1);
ds.Tables.Add(dt2);
Hope that helps!!!
I was born dumb!!
Programming made me laugh !!!
--sid--
|
|
|
|
|
Insetd of trying this:
DataAdapter=new OleDbDataAdapter("select * from Table1;select * from Table2",connection);
Try this:
SqlDataAdapter adpt1 = new SqlDataAdapter("Select * From Table1", con);
DataSet ds = new DataSet();
adpt1.Fill(ds);
SqlDataAdapter adpt2 = new SqlDataAdapter("Select * From Table2", con);
adpt2.Fill(ds);
return ds;
Naresh Patel
|
|
|
|
|
VanithaVasu wrote: I want to the two tables separately in my dataset.
How to do so?
As I told before, stored procedure's would be better approach for your problem. Write a stored procedure like
CREATE PROCEDURE [dbo].[MultipleSelect]
AS
SELECT * FROM FisrtTable
SELECT * FROM SecondTable
GO
Now Set command type to stored procedures for your OleDbCommand. Pass this stored procedures and fill dataset. This will give you two tables in dataset. Returning multiple recordset is a recommended practice by MSDN, which boosts performance.
|
|
|
|
|
Hi all,
I am publishing my web site by right clicking the solution - publish -
In the out put bin folder there exists around 600 files around 200 Dll's and 400 .compiled files. I dont know where these came from. Am i doing the publish right or not? By the way my application is working ok. Another question also is that if i need to change some thing do i need to upload all the bin folder again?
Thanks
|
|
|
|
|
Hello all,
I need an application which can read a given pdf (with multiple pages)and break it into multiple files on a given parameter.
The first objective is to develop and application which can read the whole pdf word by word into a stream, and writing the same stream into another pdf.
If someone has done any work on that, then please share the same or any apropos information.
|
|
|
|
|
hi all,
I want to update the body of my web page say every 10 seconds without having to reload the page i.e. no flickers. I just want any part of the page that has changed e.g. a table connected to a database to show the current data without the users clicking anything i.e. it should be automatic, using a particular time interval like I mentioned.
i tried using the setInterval('function1()',10000) and the page gets reloaded.but i want to avoid this.How can i implement the same using AJAX?
Thanks in advance.
Regards
Anuradha
|
|
|
|
|
If you want to do it using AJAX then grab the framework from ajax.asp.net. Then you just have to drop an updatepanel around what you want to update and a timer to trigger it.
|
|
|
|
|
hi mark,
thanks for your reply. I thought using ajax will stop refreshing the page.Can i implement the same without using ajax? if it is possible,
can you please help me with some samples?
Thanks again
Regards
Anuradha
|
|
|
|
|
With ASP.NET Ajax extension, there are two important controls called "Update Panel" and "Timer".
1. Add the UpdatePanel control to your page.
2. Add Timer control (this control from Ajax extension. not windows timer.)
3. In Tick event of timer, do the updating your page.
I saw like that one in ASP.NET Forum.
Check-out this.
http://forums.asp.net/p/1118294/1740340.aspx
Hope it helps.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
anu81 wrote: Can i implement the same without using ajax? if it is possible,
You can put the items that needs to be refreshed in seperate frame (IFrame) and reload the frame using javascript.
|
|
|
|
|
Use atlas framework and use ajax enabled controls like UpdatePanel
Sarith...
|
|
|
|
|
Hi,
I am having a really wierd problem. My page change event does not fire for my first page. Whenever i click on page 1 from any page the page change event does not fire. But when i click on other pages the event is fired properly.
Following is the code.
Since i am generating the Bound columns dynamically i am calling the getdata() method in OnInit in order to avoid
eventvalidation problem.
public partial class User_Control_Generic_Grid_ctlGenDGSelecttest : System.Web.UI.UserControl
{
string ReportDetails = string.Empty;
protected string MyData
{
get { return Request.Form[getClientName(this.txtRptDetails)]; }
set { txtRptDetails.Text = value; }
}
String getClientName(Control ctrl)
{
String result = ctrl.ClientID.Replace("_", "$");
return (result);
}
protected override void OnInit(EventArgs e)
{
if (IsPostBack)
{
getdata();
}
}
protected void Page_Load(object s, EventArgs e)
{
if (!IsPostBack)
{
string ReportParams = (string)Context.Items[ReportConstants.ReportParams];
//Setting DataKeyField Value
string ReportName = string.Empty;
string[] rptDetails = ReportParams.Split('|');
int ParamCount = (ReportParams.Split('|').Length) - 1;
for (int i = 0; i <= ParamCount; i++)
{
string[] ParamsRpt = rptDetails[i].Split('=');
if (ParamsRpt[0] == ReportConstants.ReportName)
{
ReportName = ParamsRpt[1];
}
}
SqlConnection conSQL = new SqlConnection("server=test;uid=sa;pwd=password;database=northwind");
SqlCommand cmdSelect = new SqlCommand("WebGetReportDetails", conSQL);
cmdSelect.CommandType = CommandType.StoredProcedure;
cmdSelect.Parameters.Add(new SqlParameter("@ReportName", ReportName));
DataSet dstProducts = new DataSet();
SqlDataAdapter aptrProducts = new SqlDataAdapter(cmdSelect);
aptrProducts.Fill(dstProducts);
txtRptDetails.Text = ReportParams;
ReportDetails = ReportParams;
getdata();
}
}
public virtual void PageIndexChanged_GridView(object s, DataGridPageChangedEventArgs e)
{
DataGrid gv = (DataGrid)s;
gv.CurrentPageIndex = e.NewPageIndex;
getdata();
}
public void getdata()
{
DataSet ds = new DataSet();
string rptDetailstxt = this.MyData;
if (rptDetailstxt == null)
{
rptDetailstxt = txtRptDetails.Text;
}
GridReports objBO = new GridReports();
ds = (DataSet)objBO.GridData(rptDetailstxt);
foreach (DataColumn c in ds.Tables[0].Columns)
{
grdvwCheckbox.Columns.Add(CreateBoundColumns(c));
}
grdvwCheckbox.DataSource = ds;
grdvwCheckbox.DataBind();
}
public BoundColumn CreateBoundColumns(DataColumn c)
{
BoundColumn column = new BoundColumn();
column.DataField = c.ColumnName;
column.HeaderText = c.ColumnName.Replace("_", " ");
column.DataFormatString = setFormating(c);
column.ItemStyle.Wrap = false;
return column;
}
private string setFormating(DataColumn bc)
{
string dataType = null;
switch (bc.DataType.ToString())
{
case "System.Int32":
dataType = "{0:#,###}";
break;
case "System.Decimal":
dataType = "{0:c}";
break;
case "System.DateTime":
dataType = "{0:dd-mm-yyyy}";
break;
case "System.String":
dataType = "";
break;
default: dataType = "";
break;
}
return dataType;
}
}
Please feel free to revert in case of any clarification.
Thanks!
Regards,
Anees
|
|
|
|
|
Page_Init is for only initialisation purpose. We have to initalise the components which should be displayed on page_Load.
I have initalised all the components used in the page load. But i dont know how to proceed.
Since i am also having the same problem,if you got the solution please give the solution which will me very useful for me.
VanithaVasu
|
|
|
|
|
VanithaVasu wrote: Page_Init is for only initialisation purpose. We have to initalise the components which should be displayed on page_Load.
If your controls are dynamically created and you want to persist the value on postbacks, you need to create it on Init event. Then only ASP.NET will maintain viewstate for that.
|
|
|
|
|
Anees Mitha wrote: Whenever i click on page 1 from any page the page change event does not fire. But when i click on other pages the event is fired properly.
What is page change event ? I have not heard anything like that. Please make your question more clear.
|
|
|
|
|
Sorry its PageIndexChanged event.
|
|
|
|