|
MySql.Data.MySqlClient is the provider
i am having the dll in bin also
and I am able to carry out transactions like reading data and inserting data , The only problem is while connecting it to a Gridview using the sqldatasource
Is that some plugins need to be installed on server ?
anyway thanks for the suggestions
If You win You need not Explain............
But If You Loose You Should not be there to Explain......
|
|
|
|
|
I have to upload 300000 Records from Sql Server to Oracle database using web page in Asp.net,
I was written logic, every records imported fine,
The Problem is, its taking 2 hours to upload just 17000 Records and then Asp.net breaks the loop.
Please give me the suggestion, How it can be made faster.
Regards,
Govind Bhanushali.
|
|
|
|
|
Ghehe, you need to give us loads of more information... You're question is like... 'My car is not working, what's going on?'
|
|
|
|
|
Please describe in detail
Cheers!!
Brij
|
|
|
|
|
HI Guyz
i'm creating dynamic texboxes in a tableCell and adding the table to a place holder
i'm trying to find the control so that i can use it to save data written in the texboxes,heres my code.
why cant i find the controls?
//i always get txtCtrl = null at thi point
//i used tblServer.FindControl and PlaceHolder1.FindControl, none work..
protected void btnUpdate_Click(object sender, EventArgs e)
{
for (int i = 0; i <= tblServer.Rows.Count; i++)
{
TextBox txtCtrl = (TextBox)tblServer.FindControl("txtbox" + (i + 1));
if (txtCtrl != null)
{
MessageBox.Show("txtCtrl")
}
}
}
private void CreateDynamicControls(string serverID)
{
int tblRows = Rows;
int tblCols = Columns;
tblServer = new Table();
int i = 0;
DataTable tblFields = GetData(server);
foreach (DataRow rowField in tblFields.Rows)
{
tr = new TableRow();
tcFields = new TableCell();
Label lblFields = new Label();
lblFields.Width = 60;
lblFields.Text = rowField["fieldName"].ToString();
tcFields.Controls.Add(lblFields);
tr.Cells.Add(tcFields);
DataTable tblFieldData = GetFieldData(serverID);
foreach (DataRow row in tblFieldData.Rows)
{
string txtName = "txtbox" + (i + 1);
tcFieldData = new TableCell();
TextBox txtData= new TextBox();
txtData.ID = txtName;
tcFieldData.Controls.Add(txtData);
tr.Cells.Add(tcFieldData);
i++;
}
tblServer.Rows.Add(tr);
}
PlaceHolder1.Controls.Add(tblServer);
ViewState["dynamictable"] = true;
}
|
|
|
|
|
from what I see you create the table dynamically, so maybe you should first find the table with the FindControl method and only after that the TextBox...
|
|
|
|
|
Thanks dude, that doesn't work either...
|
|
|
|
|
how do you search for the dynamic table?
I didn't see any ID for the table set anywhere... do you set it somewhere?
try to set the ID ... tblServer.ID = "tableID";
and then search for the table using:
Table tblServer = (Table)PlaceHolder1.FindControl("tableID");
this is what I would try
hope it helps.
|
|
|
|
|
it's not in the code i pasted,i tried it after your first reply,and i tried it again,
Table tblCtrl = (Table)PlaceHolder1.FindControl("tableID") returns null.
|
|
|
|
|
strange...
if it's not to long try to post your code to see what you're doing.
I don't know what else to tell you now
Andrei
|
|
|
|
|
Dude i'm also confused
heres my code:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
using System.Collections;
public partial class NewServerConfig : System.Web.UI.Page
{
DataRow odr;
Table tblServer = new Table();
string FieldName = "";
TableRow tr = new TableRow();
TableCell tcFields = new TableCell();
TableCell tcFieldData = new TableCell();
string server;
protected void Page_Load(object sender, EventArgs e)
{
if (Session["LogedInID"] != null)
{
server = Request["id"].ToString();
tblServer.ID = "tblid";
int tblRows = Rows;
int tblCols = Columns;
tblServer = new Table();
PlaceHolder1.Controls.Add(tblServer);
if (!Page.IsPostBack)
{
CreateDynamicControls(server);
}
}
else
{
Response.Redirect("login.aspx");
}
}
protected int Rows
{
get
{
return ViewState["Rows"] != null ? (int)ViewState["Rows"] : 0;
}
set
{
ViewState["Rows"] = value;
}
}
protected int Columns
{
get
{
return ViewState["Columns"] != null ? (int)ViewState["Columns"] : 0;
}
set
{
ViewState["Columns"] = value;
}
}
private void CreateDynamicControls(string serverID)
{
int tblRows = Rows;
int tblCols = Columns;
tblServer = new Table();
tblServer.ID = "tblid";
int i = 0;
DataTable tblFields = GetData(server);
foreach (DataRow rowField in tblFields.Rows)
{
tr = new TableRow();
tcFields = new TableCell();
Label lblFields = new Label();
lblFields.Width = 60;
lblFields.Text = rowField["fieldName"].ToString();
tcFields.Controls.Add(lblFields);
tr.Cells.Add(tcFields);
DataTable tblFieldData = GetFieldData(serverID);
foreach (DataRow row in tblFieldData.Rows)
{
string txtName = "txtbox" + (i + 1);
tcFieldData = new TableCell();
TextBox txtData = new TextBox();
txtData.ID = txtName;
tcFieldData.Controls.Add(txtData);
tr.Cells.Add(tcFieldData);
i++;
}
tblServer.Rows.Add(tr);
}
tblServer.ID = "tableID";
PlaceHolder1.Controls.Add(tblServer);
ViewState["dynamictable"] = true;
}
DataTable GetData(string strid)
{
string sql = "SELECT tFields.fieldName, tFields.id FROM tFields INNER JOIN tRelServerFields ON tFields.id = tRelServerFields.tFieldsFKid WHERE (tRelServerFields.tServerFKid = @serverID)";
SqlConnection oCon = new SqlConnection(DatabaseConnection.ConnectionString);
SqlCommand cmd = new SqlCommand(sql, oCon);
cmd.CommandType = CommandType.Text;
cmd.Parameters.AddWithValue("@serverID ", Convert.ToInt32(strid));
DataTable tblData = new DataTable();
new SqlDataAdapter(cmd).Fill(tblData);
return tblData;
}
DataTable GetFieldData(string strFieldID, string serverID)
{
string sql = "Select fieldData,id from tRelServerFields where tServerFKid = @serverID and tFieldsFKid= @fieldsID ";
SqlConnection oCon = new SqlConnection(DatabaseConnection.ConnectionString);
SqlCommand cmd = new SqlCommand(sql, oCon);
cmd.CommandType = CommandType.Text;
cmd.Parameters.AddWithValue("@serverID ", serverID);
cmd.Parameters.AddWithValue("@fieldsID ", strFieldID);
DataTable tblData = new DataTable();
new SqlDataAdapter(cmd).Fill(tblData);
return tblData;
}
DataTable GetFieldData(string strid)
{
string sql = "Select id from tServer where id = @serverID ";
SqlConnection oCon = new SqlConnection(DatabaseConnection.ConnectionString);
SqlCommand cmd = new SqlCommand(sql, oCon);
cmd.CommandType = CommandType.Text;
cmd.Parameters.AddWithValue("@serverID ", Convert.ToInt32(strid));
DataTable tblData = new DataTable();
new SqlDataAdapter(cmd).Fill(tblData);
return tblData;
}
protected void Button1_Click(object sender, EventArgs e)
{
Hashtable ht;
odr = (DataRow)Session["ClientLogon"];
ht = new Hashtable();
ht.Add("fieldName", txtNewField.Text);
DataAccessLayer.PopulateData("tFields", ht);
}
protected void Button2_Click(object sender, EventArgs e)
{
SaveFieldname();
CreateDynamicControls(server);
}
DataTable GetFieldid(string strName)
{
string sql = "select id from tFields where fieldName = @fieldName ";
SqlConnection oCon = new SqlConnection(DatabaseConnection.ConnectionString);
SqlCommand cmd = new SqlCommand(sql, oCon);
cmd.CommandType = CommandType.Text;
cmd.Parameters.AddWithValue("@fieldName ", strName);
DataTable tblData = new DataTable();
new SqlDataAdapter(cmd).Fill(tblData);
return tblData;
}
public void saveServerField(string strid)
{
Hashtable ht;
odr = (DataRow)Session["ClientLogon"];
ht = new Hashtable();
ht.Add("tServerFKid", Convert.ToInt32(Request["id"]));
ht.Add("tFieldsFKid", Convert.ToInt32(strid));
DataAccessLayer.PopulateData("tRelServerFields", ht);
}
public void SaveFieldname()
{
Hashtable ht;
ht = new Hashtable();
ht.Add("fieldName", txtNewField.Text);
DataAccessLayer.PopulateData("tFields", ht);
FieldName = txtNewField.Text;
DataTable dt = GetFieldid(FieldName);
string newFieldid = "";
foreach (DataRow dr in dt.Rows)
{
newFieldid = dr["id"].ToString();
}
saveServerField(newFieldid);
}
protected void btnUpdate_Click(object sender, EventArgs e)
{
for (int i = 0; i <= tblServer.Rows.Count; i++)
{
Table tblServer1 = (Table)PlaceHolder1.FindControl("tblid");
TextBox txtCtrl = (TextBox)tblServer1.FindControl("txtbox" + (i + 1));
if (txtCtrl != null)
{
Button2.Text = txtCtrl.Text;
}
}
}
}
|
|
|
|
|
I guess that your problem may be in the Page_Load method:
protected void Page_Load(object sender, EventArgs e)
{
if (Session["LogedInID"] != null)
{
server = Request["id"].ToString();
tblServer.ID = "tblid";
int tblRows = Rows;
int tblCols = Columns;
tblServer = new Table();
PlaceHolder1.Controls.Add(tblServer);
if (!Page.IsPostBack)
{
CreateDynamicControls(server);
}
//CreateDynamicControls(server);
}
else
{
Response.Redirect("login.aspx");
}
}
you first set the ID property of the table and then you instantiate a new table so the ID is lost ... I did something similar in a
test project:
Table tblServer = new Table();
protected void Page_Load(object sender, EventArgs e)
{
tblServer.ID = "tblid";
tblServer = new Table();
Response.Write(tblServer.ID);
}
and there is no output from the Response.Write method
try to set your ID again after the tblServer = new Table(); line
Andrei
|
|
|
|
|
still no luck , i noticed that tblServer.Rows.Count = 0 even though the table i dynamically created has about 4 rows...when i click the button,tblserver is null.. i'm changed my code a little,i now create the new instance in the method instead if page load,i thought that will help..
|
|
|
|
|
It Works
All i had to do was pass the form as a paremeter eg:
protected void Button3_Click(object sender, EventArgs e)
{
searchDynamicControl(this);
}
private void searchDynamicControl(Control parent)
{
......some code here
}
|
|
|
|
|
I have one doubt ... how to use Reporting service in Asp.net 2005..
J. Prabu
|
|
|
|
|
Reporting Services
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
Iam wrking in Asp.net project.
I designed the datetimepicker and a textbox to display the value od the datetimepicker.When i click the textbox the datetime picker should come like a dropdown list
how to make it?
asp:TextBox ID="txt" runat="server"></asp:TextBox>
<asp:Calendar ID="Calendar1" Visible="true" runat="server"></asp:Calendar>
I want to use a datetimepicker user control in other forms and acess it.
can anyone help/
modified on Friday, October 3, 2008 3:18 AM
|
|
|
|
|
Hi,
I guess your using the calendar control for ASP.NET...
If so, you can use the OnSelectionChanged event to implement the behavior you want.
<asp:textbox id="TextBox1" runat="server" xmlns:asp="#unknown">
<asp:calendar id="Calendar1" runat="server" onselectionchanged="cal_SelectionChanged" xmlns:asp="#unknown">
and the code for the event is:
protected void cal_SelectionChanged(object sender, EventArgs args)
{
TextBox1.Text = Calendar1.SelectedDate.ToString();
}
Is this what you want?
Andrei
|
|
|
|
|
how abt AJAX Control popup control ?
If You win You need not Explain............
But If You Loose You Should not be there to Explain......
|
|
|
|
|
hello everyone...
i have a problem regarding on Response.AddHeader("Content-Disposition", "attachment;filename=file.xls")
how can i attach the file that has specific directory??
like Response.AddHeader("Content-Disposition", "attachment;filename=C:\\Folder\file.xls") is this possible?
when i tried this codes a got the whole codes of the asp page..not the file i want..
please help...
thanks...
jyn
|
|
|
|
|
in order to use a file from the server try to specify it's path using the Server.MapPath(string path) method.
This will give you the physical path of the file on the server
try this and see if it helps you.
Andrei
|
|
|
|
|
i know now the ans.
Response.WriteFile(App_path & "\Files\\staffreport.xls")
jyn
modified on Friday, October 3, 2008 3:26 AM
|
|
|
|
|
Hi friends
In my project,the image display dynamically in aspx page.how can i export image in excel,pdf file
thanks regards
sara
Known Is Drop.Unknown Is Ocean
|
|
|
|
|
i am new to ASP.NET
Now i am creating a login page
i am using sessions to display the username
Session["str"] = TextBox1.Text;
i am using this Session["str"] where ever i need to display the username
The Problem is when i click logout
the sessions are not removed
how to clear the sessions. i want help.........
|
|
|
|
|
The Abandon method destroys all the objects stored in a Session object and releases their resources use ,
session.Abandon ;
or set session["str"]=null;
|
|
|
|