Due to some reason,the EmployeeInforma tion column's data may contain the corrupted data like Tag mismatching, missing '>' or '<' symbol . when i am trying to use CAST(EmployeeIn formation AS xml)in my query, XML error is throwing . So i want to skip that record or to handle the corrupted XML.
Is there any possible way?
Thanks,
Snehasis
User Profile
Collapse
-
snehasismishra1 replied to Is it possible to skip a bad record when selecting records from one Table?in SQL ServerSuppose in EmployeeTable table, 10 records are there. I Have used below query to retrive all the record.
Let say, after retrving 4th record XML parsing error threw. That means there is some error in 5th EmpID record(i.e in EmployeeInforma tion which is not casting to XML)Code:SELECT EmpID,CAST(EmployeeInformation AS xml) as emp, FROM EmployeeTable Order By EmpID
So i want to neglect that 5th record and retrive...Leave a comment:
-
snehasismishra1 started a topic Is it possible to skip a bad record when selecting records from one Table?in SQL ServerIs it possible to skip a bad record when selecting records from one Table?
Hi,
I am using below select query.
when there is some problem in EmployeeInforma tion, then XML parsing is throwing error and select statement is not retriving data after that record.Code:SELECT EmpID,CAST(EmployeeInformation AS xml) as emp, FROM EmployeeTable
My question is, can i retrive all the record by neglecting bad record?
Please reply ASAP.
Thanks,... -
Hi Flora,
I have also same question as you had. But i have no idea how to use "SQLLDR USERID = apps/apps_password CONTROl = x.ctl DATA = dat.txt BAD = dat.bad DISCARD = dat.dsc ERRORS=1000000 " in Select statement.
Could you please suggest me.
Thanks,
SnehasisLeave a comment:
-
snehasismishra1 started a topic How to change form2 color on button click , calling the changeColor method of form1:in C SharpHow to change form2 color on button click , calling the changeColor method of form1:
Hi,
I have two forms. Let say, form1 and form2. in form1 class, i have method ChangeColor() and i am calling this method in button click event of form2. But it is not changing the color of form2.
Please find the below code:
Below code is for form1, where on click of Button1, form2 is opening.
...Code:public partial class Form1 : Form { public Form1() { -
Hi,
I think direct conversion is not possible in c#. You can refer below example to do .
...Code:static void Main(string[] args) { byte[] myBytes = ConvertStringToByteArray("snehasis"); string hexString = BitConverter.ToString(myBytes); hexString = hexString.Replace("-", " "); Console.WriteLine(hexString);Leave a comment:
-
Hi Frank,
Sorry for the late reply. I have also not much idea :(. I read from net. you can check the below link.
http://blogs.msdn.com/b/jfoscoding/a...07/406341.aspx
Thanks,
Snehasis...Leave a comment:
-
Hi,
Add the STAThreadAttrib ute attribute on the Main method.
C#
Thanks,Code:[STAThread] static void Main(string[] args) { }
SnehasisLeave a comment:
-
Find the below code:
Thanks,Code:StringBuilder builder = new StringBuilder("DotNetQuestion"); if (Conditin) { int len = builder.Length; builder.Remove(len - 3, 3); Console.WriteLine(builder); Console.ReadLine(); }
SnehasisLeave a comment:
-
Hi,
Please find the below code.
Thanks,Code:int x = 10; string script = "<script> alert('" + x + "')</script>"; Response.Write(script);
SnehasisLeave a comment:
-
Hi,
From your question i understood, you want code for data base connection. For that i have posted the code.
...Code:using System; using System.Data; using System.Data.SqlClient; class SqlConnectionDemo { static void Main() { // 1. Instantiate the connection SqlConnection conn = new SqlConnection("Data Source=(local);Initial Catalog=Northwind;IntegratedLeave a comment:
-
Hi Kishore,
You can use below query. I have tested in sql server.
Please mark as reply if it suits you.Code:DECLARE @FullName VARCHAR(100) SET @FullName = 'XYZ ZYX' SELECT SUBSTRING(@FullName,5,7)+ SUBSTRING(@FullName,1,3)
Thanks,
SnehasisLeave a comment:
-
Hi Paul,
-1.285 ^ -0.625 = (1/-1.285)0.625 = -[(1/1.285)0.625]
and the value is negative or positive is depends on the value of power. If even then positive, else negative. So u can do as below.
double a = -1.285;
double _a = Math.Abs(a);
double b = -0.625;
double _b = Math.Abs(b);
double c = Math.Pow(_a, _b);
...Leave a comment:
-
Hi Alam,
You can add the text box value to a DataTable and then assign the DataTable to DataSource of Gridview. For reference, please find the below code.
...Code:string txt1 = "txt1"; string txt2 = "txt2"; string txt3 = "txt3"; string txt4 = "txt4"; DataTable dt = new DataTable(); dt.Columns.Add("Text1",typeof(string)); dt.Columns.Add("Text2",Last edited by Frinavale; Aug 25 '11, 03:32 PM. Reason: Please post code in code tags. Added code tags.Leave a comment:
-
can you please provide some extra information...L ike is it in ajax control or in ant third party or asp.net ... something like that...Leave a comment:
-
Hi Beemomo,
Please find the below code. I guess it will help you.
DataTable table = new DataTable();
table.Columns.A dd("Dosage", typeof(int));
table.Columns.A dd("Drug", typeof(string)) ;
table.Columns.A dd("Patient", typeof(string)) ;
table.Columns.A dd("Date", typeof(DateTime ));
...Leave a comment:
-
Hi Kim,
Please have a look on the below URL. I guess it will resolve your problem.
http://www.asp.net/ajaxlibrary/act_A...te_simple.ashx
If not, please let me know. I can give one sample application.
Thanks,
Snehasis...Leave a comment:
No activity results to display
Show More
Leave a comment: