|
Check out your nulldisplaytext property of the bound column.Could be problem occure for this.
Devjit
|
|
|
|
|
Ya i checd those cells it are empty only...,
But not getting proper answer...,
Regards,
Magi
|
|
|
|
|
I am using the following code to export data from datagrid to excel. but I am geting the error in dgresult.rows which says. what is the reason for this.
Error 20 'rows' is not a member of 'System.Web.UI.WebControls.DataGrid'
Private Sub ExportGridToExcel()
Dim Excel As Object = CreateObject("Excel.Application")
If Excel Is Nothing Then
MsgBox("Excel is not installed on this machine. This operation requires MS Excel to be installed on this machine.", MsgBoxStyle.Critical)
Return
End If
'Make Excel visible
Excel.Visible = True
'Initialize Excel Sheet
With Excel
.SheetsInNewWorkbook = 1
.Workbooks.Add()
.Worksheets(1).Select()
'Add header row to Excel Sheet by copying column headers from the Datagrid
Dim Col As DataGridViewColumn
Dim i As Integer = 1
For Each Col In dgresult.Columns
.Cells(1, i).Value = Col.HeaderText
i += 1
Next
'Add data to excel sheet by looping through the rows in the datagrid
i = 2
Dim RowItem As DataGridViewRow
Dim Cell As DataGridViewCell
For Each RowItem In dgresult.rows
Dim j As Integer = 1
For Each Cell In RowItem.Cells
.Cells(i, j).Value = Cell.Value
j += 1
Next
i += 1
Next
End With
Excel.Quit()
System.Runtime.InteropServices.Marshal.ReleaseComObject(Excel)
Excel = Nothing
MsgBox("Export to Excel Complete", MsgBoxStyle.Information)
End Sub
Chaitra N
|
|
|
|
|
With the datagrid on the web it is items not rows. It is different then the windows datagrid.
sample from microsoft help:
Dim item As DataGridItem
For Each item In ItemsGrid.Items
Label1.Text &= "<br>" & item.Cells(0).Text & _
" " & item.Cells(1).Text & _
" " & item.Cells(2).Text
Next item
Ben
|
|
|
|
|
Hi All
I am having a master page contains dropdownlist to select the language.
when write the following method just below the
public partial class Sign_in : System.Web.UI.MasterPage<br />
{<br />
protected override void InitializeCulture()<br />
{<br />
string culture = Request.Form["cmbCulture"];<br />
if (string.IsNullOrEmpty(culture))<br />
culture = "Auto";<br />
UICulture = culture;<br />
Culture = culture;<br />
if (culture != "Auto")<br />
{<br />
System.Globalization.CultureInfo ci = new System.Globalization.CultureInfo(culture);<br />
System.Threading.Thread.CurrentThread.CurrentCulture = ci;<br />
System.Threading.Thread.CurrentThread.CurrentUICulture = ci;<br />
}<br />
<br />
base.InitializeCulture();<br />
}<br />
<br />
protected void Page_Load(object sender, EventArgs e)<br />
{}<br />
<br />
}<br />
following error occur only with he master page:
'Sign_in.InitializeCulture()': no suitable method found to override
while same process is working in aspx page.
Thanks in advance..
Regards,
Sri..
|
|
|
|
|
how to code to rate forum in asp.net using c# and its design.
harika
|
|
|
|
|
we cannot do your homework.
Regards,
Satips.
|
|
|
|
|
I doubt this is homework, homework askers usually type in a comprehensive question, exactly as it was assigned to them.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Exactly CG.
Regards,
Satips.
|
|
|
|
|
It's really pretty simple - you want to allow people to make a rating, you want to store each rating with the person who did it, so they cannot rate twice, and you need to count them.
Which bit are you stuck on ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
thanks..i have stored my rate in database
------------------------------------------
x = rbtnRating.SelectedItem.ToString();
switch (x)
{
case "Excellent":
strRate = "5";
break;
case "Good":
strRate = "4";
break;
case "Average":
strRate = "3";
break;
case "Bad":
strRate = "2";
break;
case "Terrible":
strRate = "1";
break;
}
SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["KMSConnectionString"]);
con.Open();
string str = "insert into Rating(Rate,Authorname,Replies,QId) values('" + strRate + "','" + btnName.Text + "','" + lblReply.Text + "' ,'" + btnSno.Text + "' )";
SqlCommand cmd = new SqlCommand(str, con);
cmd.ExecuteNonQuery();
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter(str, con);
da.Fill(ds);
but in retriving the database
------------------------------
SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["KMSConnectionString"]);
con.Open();
string sto = "select rate from rating where Authorname='" + btnName + "'";
DataSet ds1 = new DataSet();
SqlCommand com = new SqlCommand(sto, con);
String str3 = com.ExecuteNonQuery().ToString();
SqlDataAdapter da1 = new SqlDataAdapter(sto, con);
da1.Fill(ds1);
int countC = ds1.Tables[0].Rows.Count;
if (countC != 0)
{
for (int j = 0; j < countC; j++)
{
str3 += str3;
total = ((Convert.ToInt16(str3)) / (5 * countC));//here is my problem
}
}
Label1.Text = total.ToString();
harika
|
|
|
|
|
what problem it says?
Regards,
Satips.
|
|
|
|
|
thers is a problem in binding the data to the label.could u please check the retriving code rating.
harika
|
|
|
|
|
code to download file from sqlserver in asp.net using c#
harika
|
|
|
|
|
we cannot do your homework.
Regards,
Satips.
|
|
|
|
|
why would you try to find it in internet.?
|
|
|
|
|
Hello members,
I have to create a cutom control for dropdownlist which have records populated in a datagrid(display) or table format having different columns .When any one item of dropdownlist is selected then the selected value is displayed in an another textbox .
So i request you to please help me in this regard.
Thanks and Regards,
Jai
|
|
|
|
|
Please clerify that, Textbox control used with custom control or on page where you use custom contlrol.
Parwej Ahamad
g_parwez@rediffmail.com
|
|
|
|
|
I want to create a custom control which i have to use on an aspx page.
The custom control to be designed is Dropdownlist which when clicks shows a table of records.
|
|
|
|
|
Ok,
(1) Create an event on u'r user control
(2) Raise this event on when select value from list box
(3) Trace this event on your Aspx page where u have to use user control.
Note: If you have to use C#, Then use Delegates for the trap the event
or
If you use VB.Net then u can use withevent .
Parwej Ahamad
g_parwez@rediffmail.com
|
|
|
|
|
hi friends
i have a problem in web based cheating application where we using a chat window of with scrollbar,i wana scroll bar always at bottom and i have done, but prblm is that i am using a hash table for coming msg.hash table work on btn click through javascript timer.prblm come when the btn click post back occerd so i wanat any control which not fierd postback . and have click event
Piyush Vardhan Singh
Programmer
TAS NewDelhi
India
9313077379
|
|
|
|
|
What's your need. You would to click client side or server side. And which kind of operation you would like to perform................
Parwej Ahamad
g.parwez@gmail.com
|
|
|
|
|
abe mane ek bttm li hai server side aur usko click kar raha hun javascript ke through jo ki bttm ke click pe hashtable se msg chat window pe jaye ga but jub bottom click hota hai page lode hota hai aur mai chahata hun ki page na lode ho aur ye asp.net me hai main mudda ye ki jab hash table se msg chat windo pe jaye to page lode na ho chae jis tarike se
Piyush Vardhan Singh
Programmer
TAS NewDelhi
India
9313077379
|
|
|
|
|
please learn English and use english here.
Regards,
Satips.
|
|
|
|
|
hey man(Satips) this msg not for u. i am talking to my friends ok minde ur own bussiness ok
Piyush Vardhan Singh
Programmer
TAS NewDelhi
India
9313077379
|
|
|
|