|
try
TextBox1.Attributes.Add("OnClick", "javascript:alert('This is just sample');");
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
|
|
|
|
|
Thanks!
Works perfectly!
-= Reelix =-
|
|
|
|
|
You are welcome.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
|
|
|
|
|
Hi,
i am inserting records from a datatable to sql server 2005 database using sqlbulk copy.
The problem is that the datasource datatype is different from sql server table datatype.
Is there any way to convert the datatype to there corresponding datatypes in the table.
thanks
|
|
|
|
|
no one has the answer???????????
Vijay V.
|
|
|
|
|
Usually I import into a staging table where every column is a varchar, then validate the contents to the real data type before moving them to the actual destination table. This gives you a chance to perform other validation too.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
HI,
is there any way to detect that what kind of value is there in an .csv file rows??
thanks
Vijay V.
Yash Softech
|
|
|
|
|
Not until its in a table. You should be able to do some basic checks as you know the final destination table.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hi Bob,
thanks for reply.
I was googling and found that I can use Namespace System.Microsft.SqlServer.SMO that has a class datatype using which I can set the datatype depending on my requirement but this I m not able to import this class in my project.
Do u have any idea regarding this
here is the code
public DataType GetDataType(string dataType)
{
DataType DTTemp = null;
switch (dataType)
{
case ("System.Decimal"):
DTTemp = DataType.Decimal(2, 18);
break;
case ("System.String"):
DTTemp = DataType.VarChar(50);
break;
case ("System.Int32"):
DTTemp = DataType.Int;
break;
}
return DTTemp;
}
Thanks
Vijay V.
Yash Softech
|
|
|
|
|
You can do it from there, or this sql works too
select column_name,data_type
from information_schema.columns
where table_name = '<yourtable>'</yourtable>
|For details on using the smo method see my CP article [^]
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hi Bob,
thanks for the help.
Vijay V.
Yash Softech
|
|
|
|
|
No problem
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hi,
I have taken refrence of Microsoft Excel 11.0 Object Library in my project to export data in Excel. And included following Name spaces
Imports Microsoft.Office.Interop
Imports System.Runtime.InteropServices.Marshal
Now i have declared following variables.
Dim objExcel As New Excel.Application
When i execute the code it gives Access Denied Error.
I check all the sharing and Security settings.
Your comments will be highly appreciated.
Thanks
Binod K.
(Miles to go before I sleep)
|
|
|
|
|
|
Hello Friends,
I am developing as application in ASP.Net with code behind as VB.
I have declared a variable as shared in a code behind class like:
Partial Class MyPage Inherits System.Web.UI.Page
Public Shared MyArray(1,2) as String
Now, how can i access this MyArray in some other code behind class?
Plz help me.
Thanks and regards,
Nagendra.
|
|
|
|
|
Why dont you put your array in a common methods class and then just access that from your class pages
|
|
|
|
|
Sorry, i didn't understand. Can u plz explain.
|
|
|
|
|
Put a page class in your app folder and put the array in there. Then you can reference that page from other pages.
|
|
|
|
|
It worked.....Thanks
|
|
|
|
|
Glad to hear it
|
|
|
|
|
Hi runtime i am telling whats my mail body have to contain...,
But its not at all considering that for loop of j and inside if condition:
This is my code:
foreach (FileInfo f in fInfos)
{
attach = new MailAttachment(f.FullName);
for (int j = DS.Tables.Count - 1; j < DS.Tables.Count; j++)
{
if(Path.GetFileNameWithoutExtension(d.Name)==DS.Tables[j].Rows[0][1].ToString())
{
mbody = "<table width='600' style='FONT-SIZE: 8.5pt; COLOR: #003d6a; FONT-FAMILY: tahoma; HEIGHT: 24px'>" +
"<tr bgcolor='#F1F1F1'><td colspan='2' align='left' height='25px'><b>Time Sheet For Last Week Employee Details :</b></td></tr>" +
"<tr><td>Employee Name:</td><td>Working Dates :</td><td>Worked Dates :</td></tr>" +
"<tr><td>" + DS.Tables[j].Rows[0][2].ToString() + "</td>" +
"<td>" + DS.Tables[j].Rows[0][3].ToString() + "</td>" +
"<td>" + DS.Tables[j].Rows[0][4].ToString() + "</td></tr>" +
"</table>";
}
mailMessage.Body = mbody;
}
|
|
|
|
|
New one wrote: for (int j = DS.Tables.Count - 1; j < DS.Tables.Count; j++)
what you are trying to do with the loop?
That loop always iterates one time.
|
|
|
|
|
Add TabPanel inside a tabpanel of ajax tabcontainer
i need to add a subtabpanel in side a main tabpanel
Here is a sample code
Protected Button_Click(object sender,EventArgs e)
{
Listbox ListBox1 = new ListBox();
ListBox1.SelectedIndexChange += new EventHandler(ListBox1_SelectedIndexChange);
AjaxControlToolkit.TabPanel Maintab = new AjaxControlToolkit.TabPanel();
Maintab.Controls.Add(ListBox1);
TabContainer1.Tabs.Add(Maintab);
}
void ListBox1_SelectedIndexChange(object sender,EventArgs e)
{
// This code does not works
string str = Listbox1.SelectedItems.Text.Trim();
}
i want to add a sub tab inside the Maintab on selected index change of the listbox.
i have tryed in this way too
i.e declared the ListBox as common
ListBox Listbox1 = new ListBox();
Protected Button_Click(object sender,EventArgs e)
{
ListBox1.SelectedIndexChange += new EventHandler(ListBox1_SelectedIndexChange);
AjaxControlToolkit.TabPanel Maintab = new AjaxControlToolkit.TabPanel();
Maintab.Controls.Add(ListBox1);
TabContainer1.Tabs.Add(Maintab);
}
void ListBox1_SelectedIndexChange(object sender,EventArgs e)
{
// This code does not works only for a single tab alone
string str = Listbox1.SelectedItems.Text.Trim();
AjaxControlToolkit.TabPanel stab = new AjaxControlToolkit.TabPanel();
stab.Header = str;
TabContainer1.Tabs.Add(stab);
}
Can Any Help me Please.
Bharani
|
|
|
|
|
Add Ajax TabPanel Dynamically on button click
I have placed the TabContainer From ajax toolkit i want to add the tabs dynamically on button click.
Help me.
Bharani
|
|
|
|
|