|
For this kind of value you have to use ' or " to enclose the Value
Ex// 1,'john,store',aroda
Best Regards,
Chetan Patel
|
|
|
|
|
Hi Chetan,
This did not work when I read "1,'john,store',aroda" from file and split it on comma to convert to a datatable, "john" and "store" are coming in different columns. I want this in same column.
Regards,
Prajin
|
|
|
|
|
Can u please post the code??
|
|
|
|
|
try
{
memStream = new MemoryStream(fileImport.FileBytes);
reader = new StreamReader((Stream)memStream);
int nCurrPosition = 0;
int nNoOfCharactersToBeRead = Convert.ToInt32(reader.BaseStream.Length) - nCurrPosition;
szRawString = "";
if (nNoOfCharactersToBeRead >= 0)
{
reader.BaseStream.Seek(0, SeekOrigin.Begin);
char[] vBuffer = new char[nNoOfCharactersToBeRead];
reader.Read(vBuffer, 0, nNoOfCharactersToBeRead);
if (vBuffer.Length != 0)
{
szRawString = ReArrangeStringEx(vBuffer);
}
}
if (szRawString != "")
{
szRawString = szRawString.Replace("\r", "");
string[] rows = szRawString.Split("\n".ToCharArray());
for (int j = 0; j < rows.Length; j++)
{
string[] columns = rows[j].Split(',');
if (dtCustomer.Columns.Count == columns.Length)
{
dtCustomer.Rows.Add(columns);
}
}
}
reader.Close();
memStream.Close();
|
|
|
|
|
Well you're not operating on this as a CSV (which would honour the quotes as a text identifier) - you're simply splitting the string using comma:
string[] columns = rows[j].Split(',');
If you want to roll your own code to read from a CSV then you'll need to build something into this line above that honours quotes as a text identifier.
|
|
|
|
|
I suppose u first split your string by ' and then split it by comma. Hope it works.
|
|
|
|
|
for (int j = 0; j < rows.Length; j++)
{
string[] columns = rows[j].Split(',');
if (dtCustomer.Columns.Count == columns.Length)
{
dtCustomer.Rows.Add(columns);
}
}
change your code like this
arrTemp[]=rows[j].Split("'")
you get three parts
1,'abc,def',asd
as 1,
abc,def
,asd
now
add this like this
for (int j = 0; j < rows.Length; j++)
{
arrTemp[]=rows[j].Split("'")
dtCustomer.Rows.Add(arrTemp[0].subString(1,arrTemp[0].Length-1);
dtCustomer.Rows.Add(arrTemp[1]);
dtCustomer.Rows.Add(arrTemp[2].subString(2);
}
Best Regards,
Chetan Patel
|
|
|
|
|
Hi All,
I have a GridView in which all the column are template Column that contain textbox as a item Template. I have defined textChanged event for textboxes.
I have made these textbox as AutopostBack as true so that if I make any change in this textbox I can get that change in code behind file.(I wan to do with code behind file only no JavaScript)
Now if I edit any textbox which is inside the Gridview Problem lies here if I edit the textbox ,the textbox event for that textbox is called as many as time as there are number of rows in gridview and moreover it happen only when I edit the textbox for firsttime after that it execute only for only once .
So if someone has met with this problem pls do update me .
Thanks
Rahul
|
|
|
|
|
Check the URL can read some of the articles vert helpfull while working with gridview http://gridviewguy.com/CategoryDetails.aspx?categoryID=7[^]
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Sorry Guy.
You can not handle Textbox events.
Best Regards,
Chetan Patel
|
|
|
|
|
Hello everyone,
This is developed in .Net 2.0 (ASP .NET with VB .NET as code)
In a page, I have 9 fields for user to upload files. I have just encountered a situation where I choose a file for all the fields (that means 9 files), and when the total sum of file size (of the 9 files) exceeds a certain amount, the next page that I see after I click on submit is "Page cannot be displayed".
When I choose the 9 files with smaller size, the system works just fine.
Do you have any idea if there is such a limitation on the file size to be uploaded in a form? If there is, what is the size?
Appreciate your help.
Thanks,
Yenyen
|
|
|
|
|
That's becuase you are going beyond default maximum size that request can have you need to make it more in Web.config
httpRuntime maxRequestLength="100000" add this in system.web tag
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Dear All,
I have a gridview where first 2 columns are bound fields.
Next 3 columns have template fields with textboxes which are requiered to be filled by user.
i want if user does not provide any value, should be informed then and there through javascript.
I have written one which displays message but focus moves to next field.
I have given my code below.
Please help me.
Thanks;
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<title>Untitled Page
<asp:gridview id="GridView1" runat="server" autogeneratecolumns="False" width="552px" cellpadding="4" forecolor="#333333" gridlines="None">
<columns>
<asp:templatefield headertext="SUB_ID">
<itemtemplate>
<asp:textbox id="TextBox1" runat="server" text="<%# Bind("sub_ID") %>">
<asp:templatefield headertext="name">
<itemtemplate>
<asp:textbox id="TextBox2" runat="server" text="<%# Bind("sub_name") %>">
<asp:templatefield headertext="Marks">
<itemtemplate>
<asp:textbox id="TextBox3" runat="server">
<asp:templatefield headertext="Marks-II">
<itemtemplate>
<asp:textbox id="TextBox4" runat="server">
<asp:templatefield headertext="MARKS-III">
<itemtemplate>
<asp:textbox id="TextBox5" runat="server">
<footerstyle backcolor="#507CD1" font-bold="True" forecolor="White">
<rowstyle backcolor="#EFF3FB">
<editrowstyle backcolor="#2461BF">
<selectedrowstyle backcolor="#D1DDF1" font-bold="True" forecolor="#333333">
<pagerstyle backcolor="#2461BF" forecolor="White" horizontalalign="Center">
<headerstyle backcolor="#507CD1" font-bold="True" forecolor="White">
<alternatingrowstyle backcolor="White">
<asp:button id="Button1" runat="server" text="Button">
-----------------------------
var gridViewCtlId = '<%=gridview1.ClientID%>';
var gridViewCtl = null;
var curSelRow = null;
var curRowIdx = -1;
function getGridViewControl()
{
if (null == gridViewCtl)
{
gridViewCtl = document.getElementById(gridViewCtlId);
}
}
function onGridViewRowSelected(rowIdx)
{
var selRow = getSelectedRow(rowIdx);
if (null != selRow)
{
curSelRow = selRow;
var cellValue = getCellValue(rowIdx, 0);
alert(cellValue);
}
}
function getSelectedRow(rowIdx)
{
return getGridRow(rowIdx);
}
function getGridRow(rowIdx)
{
getGridViewControl();
if (null != gridViewCtl)
{
return gridViewCtl.rows[rowIdx];
}
return null;
}
function getGridColumn(rowIdx, colIdx)
{
var gridRow = getGridRow(rowIdx);
if (null != gridRow)
{
return gridRow.cells[colIdx];
}
return null;
}
function getCellValue(rowIdx, colIdx)
{
var gridCell = getGridColumn(rowIdx, colIdx);
switch(gridCell.childNodes.item(0).value)
{
case "":
gridCell.childNodes.item(0).focus();
alert("Please enter the value");
break;
return false;
default:
return true;
}
}
--------------------------------
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
LoadGridData()
End If
For Each row As GridViewRow In GridView1.Rows
rowIndex = rowIndex + 1
For ctr = 0 To 4
CType(row.FindControl("Textbox" + (ctr + 1).ToString), TextBox).Attributes("onblur") = "javascript: return getCellValue(" + rowIndex.ToString() + "," + ctr.ToString() + ")"
Next
Next
End Sub
sanjay kumar samantaray
|
|
|
|
|
This is my code
Session["MySession"]="My Session Value";
In web.config
<sessionstate mode="SQLServer"
="" cookieless="true" regenerateexpiredsessionid="true" timeout="30" sqlconnectionstring="Data Source=MySqlServer;Integrated Security=SSPI;" statenetworktimeout="30">
In which table my session data will store in the MySqlServer database.
|
|
|
|
|
TempDB
Best Regards,
Chetan Patel
|
|
|
|
|
Hi,
I am new in asp.net2.0 ,I have create one project,
In project folder I don't have a bin folder and project source file,
how i create this files,
thanks
|
|
|
|
|
Right click the project you can see the bin menu under Add ASP.Net Folder. it will create a bin folder.
|
|
|
|
|
Thanks for your reply,
Bin folder create but there no project dll file.
Also how to create project source file
thanks
r
|
|
|
|
|
IF its Web aaplication dll wil not be created if you have class library in you application then dll will created of that application not of web application. Only you can have to precompile the web application
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
I am currently developing an AJAX enabled calendar
i have a back and forward button that scrolls through the month of the year
A global variable called currentDate is set during the first load, and and it will be changed by the event handler for the back and forward buttons
however, right now for some reason, the global variable resets itself to the declared default value automatically every time i press the back/foward button.
I think i am doing something wrong the updatepanels and stuff
I wrote the calander, the back and forth button in a control and then i place the control in a updatepanel in the actual page.
It seems like that the control is being re-created everytime i press the button?
can someone help!?
|
|
|
|
|
In windows application:
in (asp.net + c#)
i have added checkbox in datagridview.
on click of checkbox i was not able to sea the effect ( i want to calculate sum of column 2 values of selected rows )
but it executes only on leave of cell.
how to do that ?
Thank you.
vijaya
|
|
|
|
|
Can any one help me to get the MCTS Study material or dumps.
Planning to give the exam .
Pls suggest me where i can get the dumps and good boooks related to that exam
|
|
|
|
|
Which Paper r u planning to give, there is one book in the market which cost around Rs. 750 to 800 /- or u can download this book from net also.
I have dumps but they r 6 months old which I suppose wont be helpful to u because it changes after every 6-7 months.
All the best.
|
|
|
|
|
I am a software programmer with exp in Web applictaions Using VB.net and ASP.net . and I am planning to give the exam
1. 70-528VB TS: Microsoft .NET Framework 2.0 - Web-based Client Development - Visual Basic 2005
2. 70-536VB - TS: Microsoft .NET Framework 2.0 - Application Development Foundation - Visual Basic 2005.
Can you give the name of the book plz.
and dumps if available , give the older one if you have so that I can get the idea of the exam.
Thanks in Advance.
|
|
|
|
|
Great to know this, I have clear my 528 paper in the month of may. Book is:
Go with Microsoft .Net Framework 2.0 Application development foundation self paced Training kit MCTS Exam 70-536 and Microsoft .Net Framework 2.0 Web-based Client Development self paced Training kit MCTS Exam 70-528.
This book is available in market with the cost of Rs.795.
I got the certification using this book only.
It is a very good book for .Net2.0 Certification
If u can give me ur mail ID then I will forward u the pdf so that u dont have to buy the book.
|
|
|
|