|
Because maybe he didn't debug his code.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
|
|
|
|
|
New one wrote: DS.Tables[DS.Tables.Count - 1].Rows
If there is only one Table in the DS always, Why cant you use a DataTable.
New one wrote: drc.Table.Rows[k][1].ToString()
Set a break point a check what value is there in the above code.
|
|
|
|
|
Hopefully an easy one guys
Need to put % signs around an sql parameter in a stored procedure
something like %@value%
anyone have any ideaS?
thanks
|
|
|
|
|
this works for me in SQL 2000
CREATE PROCEDURE SpName AS<br />
<br />
declare @paramVal as varchar(4000)<br />
set @paramVal='value'<br />
select * from TableName where columnName like '%'+@paramVal+'%'<br />
GO
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
|
|
|
|
|
Thanks that worked!
|
|
|
|
|
You are welcome dude
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
|
|
|
|
|
Hi all!
I've been using the OnClientClick with the Button control for awhile now to execute JavaScript without causing page validation:
Button1.OnClientClick += "javascript:doThis(); return false;";
but one thing still eludes me...
Is it possible to execute the OnClientClick event on a textBox?
If anyone can figure out any solution, I would be highly grateful!
-= Reelix =-
|
|
|
|
|
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.
|
|
|
|