Hi Friends, I have gridview with 2 columns "Tower" - dropdown template field and "Country" - dropdown template field. I have datatable with 2 columns Tower and Country and has 100 rows. Now my need is to attach this datatable to gridview, but i should not get 100 rows in gridview, i should get only one row, where Tower and Country dropdown should contain all 100 rows data as Listitem respectively. (i.e.,) Gridview should contain only one row with 100 items in each column dropdown. Please help in this, I am stuck in this. Regards, Priyaa.
priyaahh
Posts
-
How to bind multiple rows from data table to single row in Gridview -
Enable / Disable Regular Expression Validator based on Dropdownlist selectionHi Friends, I have DropdownList, Textbox and RegularExpression Validator in Gridview's ItemTemplate. RegularExpressionValidator is to validate the percentage in Textbox entry. This RegularExpressValidator should enable only based on dropdownlist selection. i.e., if dropdownlist selection is "Percentage" then, validator should enable to validate textbox entry. I have tried many ways in Javascript and .cs code, but no luck. Please help in this. Regards, Priyaa.
-
How to Handle Null using LINQ during Datatable CrossJoin C#Hi Richard, Thanks lot for your response, it working for me. Regards, Priyaa.
-
How to Handle Null using LINQ during Datatable CrossJoin C#Hi Friends I have multiple datatables, and the datatables may or may not have data, depends on the user selection. I have to get Cartesian Product of all the Datatables, and pass the Cartesian Product result as datasource for Gridview. I am using following code which is working fine if all the DataTable has rows. If any of the table is not having row, then I am getting no records in my resultant cartesian product table. Please help in this. var newDatatable = from TowerName in dtTower.AsEnumerable() from CountryName in dtCountry.AsEnumerable() from Level in dtLevel.AsEnumerable() from CityName in dtCity.AsEnumerable() from BandName in dtBand.AsEnumerable() from EType in dtEmploymentType.AsEnumerable() from Skill in dtSkill.AsEnumerable() select new { TowerName, CountryName, Level, CityName, BandName, EType, Skill }; DataTable dtlinq = new DataTable("poclinq"); foreach (var item in newDatatable) { DataRow dr = dtlinq.NewRow(); dr["TowerName"] = item.TowerName.ItemArray[0]; dr["CountryName"] = item.CountryName.ItemArray[0]; dr["Level"] = item.Level.ItemArray[0]; dr["CityName"] = item.CityName.ItemArray[0]; dr["BandName"] = item.BandName.ItemArray[0]; dr["EType"] = item.EType.ItemArray[0]; dr["Skill"] = item.Skill.ItemArray[0]; dtlinq.Rows.Add(dr); }
-
XMLBulkCopy Error in VBScriptHi Friends, I am trying to do Bulkcopy of xml records to SQL Server 2008. I am using the below code. But I am getting error "
ActiveX component can't create object SQLXMLBulkLoad.SQLXMLBulkLoad"
This is my code:
Set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkLoad")
objBL.ConnectionString = "server=Testdb;Database=CApp;UID=dbo;Password=dbo;LANGUAGE=us_english"
objBL.ErrorLogFile = "c:\error.log"
objBL.Execute "c:\customermapping.xml", "c:\customers.xml"
Set objBL = NothingPlease help. Thanks and Regards, R. Sangeetha Priya.
-
Data missing While importing Text file (.txt) to sql server 2008 using ASPHi Friends, I am using asp to import data from .txt (tab delimited) to SQL Server 2008. I have found some problem with my code now. ie., some data is not getting read from textfile hence its not inserted into table. But still data present in .txt. I am not sure what will be the cause for this issue. Below is my code.
cnnText.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & \_ "Data Source=D:\\Sangeetha\\commodul\\ACDT\\UploadFile\\;" & \_ "Extended Properties=""text;HDR=YES;IMEX=0;FMT=TabDelimited""" ' Load ADO Recordset with Text Data Set rstText = Server.CreateObject("ADODB.Recordset") 'rstText.Open "Select \* from \[" & file\_name & "\]", cnnText,2,3,adcmdText rstText.Open "Select \* from \[" & file\_name & "\]", cnnText Set rstAccess = Server.CreateObject("ADODB.Recordset") rstAccess.Open "select \* from CReport", connection, 2,3 Do Until rstText.EOF With rstAccess 'if not(isnull(rstText.Fields("reporting\_date"))) then .AddNew .Fields("credit\_group").Value = rstText.Fields.Item("credit\_group") .Fields("credit\_group\_aig\_number").Value = rstText.Fields.Item("credit\_group\_aig\_number") .Fields("credit\_group\_gdr\_id").Value = rstText.Fields.Item("credit\_group\_gdr\_id")'new .Fields("credit\_group\_domicile\_code").Value = rstText.Fields.Item("credit\_group\_domicile\_code") .Fields("credit\_group\_domicile").Value = rstText.Fields.Item("credit\_group\_domicile") rstText.MoveNext 'else 'rstText.MoveNext 'end if End With Loop rstAccess.UpdateBatch
I have tried by keeping IMEX as 1. Only for some of the columns this problem is happening. Eg:
credit_group_aig_number
is a column where for some row records is getting read and for some row this col value its not at all reading from connector. I tried with Response.Write, no value is printing even that row is having value in text file. I have noticed that column has input of 9 digit id which starts with number as well as alphabet. Only where its start with alphabet this is problem. Kindly help. Thanks,
-
Out of Memory error in asp while fetching data from sql and display around 1,00,000 recordsHi Friends, I have following issue in asp page…can you pls give any idea for this.. In my asp page I am displaying records from db table to asp page in table format that’s all.. but that table will have more than 1,00,000 records.. So at the time while displaying, its displaying some records around 15,000 then showing the following error. Response object error 'ASP 0100 : 8007000e' Out of memory /aiucreditdev/credit/ImportTCMonthReportStatus.asp, line 0 Unable to allocate required memory. Please help. Thanks in advance, Priya.
-
How to configure the directory name in vba excel codeHi All, I am using the following line hardcoded in my vba code in excel file. D:/PISL/Input/ My problem is, in the above line instead of giving D: i should give only PISL/Input/, this can exists in any of the drives like c:, d:, e:, etc., Please help how to configure the drive name. Thanks in Advance, Regards,
-
Uploading Larger FilesHi, I am trying to upload larger file (txt file size is 8 MB) in aspx page, for this i have made changes to web.config file <httpRuntime executionTimeout="240" maxRequestLength="20480" /> When i try this page local it is working fine, the file is getting uploaded. When i tried to access this upload page URL from some other machine, pointing the url to my machine, i am getting timeout error. Please help me what is the problem here. Thanks in Advance, Regards, priyaah.
-
Reading Spanish CharactersHi Friends,
I am reading cells from excel vba and storing in oracle database.
I have a problem here: there are some special characters as well as spanish characters in some of the cells in excel. This is not reading properly and storing properly (means storing the same as it is given in excel cell) in the database.For Eg: string like : mph-434ĆEĘ needs to be read and stored using Vba.
Kindly help how to read spanish characters from excel using vba and store in db.
Thanks in Advance,
Regards,
-
Export excel data to SQL server in ASPHi Friends, Kindly help me for this. I wanted to export of excel data to table in sql server. I have to compare the column name in excel and table then export that column then next column. Like this i wanted this export. Please help... Thanks in Advance, Regards,
-
Replacing & during conversion of Excel to XML using VBAHi Annie, Thanks for your reply. I tried using & but when i use this, I am not getting any output and the application is processing.....and not stopping..I have to use TaskManager and End the application. Kindly help. Regards, Priya.
-
Adding Attributes to XML node using VBAHi Dave, Thank you so much for ur kind and immediate reply...it worked. :-) Regards, Priya.
-
Replacing & during conversion of Excel to XML using VBAHi, & is not working. Its going into infinitely....Any other approach to implement this? Thanks, Priya.
-
Replacing & during conversion of Excel to XML using VBAHI Thanks. I have not tried it ..let me try and reply Thanks, Priya.
-
Replacing & during conversion of Excel to XML using VBAHi Dave, Thanks. I think you are talking abt the function i ve written..without returning that function..with function name.. I have that line in my code..since it is big code i just copy pasted only first part and end function missed to paste last to previus line. Here is the function: Function RemoveAmpersands(AnyStr As String) As String Dim MyPos As Integer ' replace Ampersands (&) with plus symbols (+) MyPos = InStr(1, AnyStr, "&") Do While MyPos > 0 Mid(AnyStr, MyPos, 1) = "+" MyPos = InStr(1, AnyStr, "&") Loop RemoveAmpersands = AnyStr End Function If you are trying to say something pls reply.. Thanks Priya
-
Replacing & during conversion of Excel to XML using VBAHi Thanks. Yes my code is replacing & with +. Because if i display as & in XML it is giving error. But i wanted to display & as & not as +. Is there any wy to display & in XML browser. Regards, Priya.
-
Replacing & during conversion of Excel to XML using VBAHi Friends, I am converting an excel to xml using vba. THere this excel data having &. But when converting & to xml it is giving error. So I am using the following funtion to replace &. Function RemoveAmpersands(AnyStr As String) As String Dim MyPos As Integer ' replace Ampersands (&) with plus symbols (+) MyPos = InStr(1, AnyStr, "&") Do While MyPos > 0 Mid(AnyStr, MyPos, 1) = "+" MyPos = InStr(1, AnyStr, "&") Loop End But the above function replacing with +. But I wanted to display in the browser as & only. Kindly Help. Regards, Priya.
-
Adding Attributes to XML node using VBAHi Dave, Yes I have noticed that and changed...but why the function is not returning anything. Regards, Priya.
-
Adding Attributes to XML node using VBADave, <pre attribute="vb"> Yes I did debut and breakpoints. Actually I have to keep getNodeAttribute function in the first set not in the second set. I examined that. During call of the above function i print the var in immediate window. it is printing like : Attribute=1,1,0,1,16711680,2,0,0,1,16711680,0,0,0,0,0,0.5,10,Arial,1" Attribute2=" but when it go back to the main line from where are calling the function it is not returning anything.. Hope u might got my explanation..pls help This is my function: Function getNodeAttributes(node As String) As String dim str_att as string If node = "Policy_Years" Then str_att = "Attribute=" & "1,1,0,1,16711680,2,0,0,1,16711680,0,0,0,0,0,0.5,10,Arial,1"" Attribute2=""" ElseIf node = "Loss_Descriptions" Then str_att = "Attribute=" & "1,1,0,1,16711680,2,0,0,1,16711680,0,0,0,0,0,0.5,10,Arial,1"" Attribute2=""" Debug.Print str_att End If End Function Calling the above function from the below line: strXML = strXML & "<" & Nodes(t) & getNodeAttributes(Nodes(t)) & ">" I wanted output like: <Adjusted_Loss_PD Attribute="1,1,0,1,16711680,2,0,0,1,16711680,0,0,0,0,0,0.5,10,Arial,1" Attribute2=""> <Adjusted_Loss_PD-1 /> <Adjusted_Loss_PD-2 /> <Adjusted_Loss_PD-3 /> <Adjusted_Loss_PD-4 /> <Adjusted_Loss_PD-5 /> <Adjusted_Loss_PD-6 /> <Adjusted_Loss_PD-7 /> <Adjusted_Loss_PD-8 /> <Adjusted_Loss_PD-9 /> <Adjusted_Loss_PD-10 /> </Adjusted_Loss_PD> </pre>