|
hi i m using asp.net when i edit any feild it will generate a error.
code is
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" DataKeyNames="material_issueno"
Style="position: relative;" AllowPaging="True" PageSize="20" AutoGenerateEditButton="True" OnRowEditing="GridView1_RowEditing1" CellPadding="4" ForeColor="#333333" GridLines="None">
<Columns>
<asp:BoundField DataField="material_issueno" HeaderText="material_issueno" InsertVisible="False"
ReadOnly="True" SortExpression="material_issueno" />
<asp:BoundField DataField="materialissue_date" HeaderText="materialissue_date" SortExpression="materialissue_date" />
<asp:BoundField DataField="qty" HeaderText="qty" SortExpression="qty" />
<asp:BoundField DataField="sno_to" HeaderText="sno_to" SortExpression="sno_to" />
<asp:BoundField DataField="sno_from" HeaderText="sno_from" SortExpression="sno_from" />
<asp:BoundField DataField="issue_to" HeaderText="issue_to" SortExpression="issue_to" />
<asp:BoundField DataField="issue_by" HeaderText="issue_by" SortExpression="issue_by" />
<asp:BoundField DataField="clientname" HeaderText="clientname" SortExpression="clientname" />
<asp:BoundField DataField="entered_by" HeaderText="entered_by" SortExpression="entered_by" />
<asp:BoundField DataField="ptypename" HeaderText="ptypename" SortExpression="ptypename" />
<asp:BoundField DataField="remarks" HeaderText="remarks" SortExpression="remarks" />
<asp:BoundField DataField="invoice" HeaderText="invoice" SortExpression="invoice" />
</Columns>
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
<EditRowStyle BackColor="#999999" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:inventryConnectionString53 %>"
SelectCommand="SELECT * FROM [material_issue] ORDER BY [material_issueno] DESC"
Updatecommand="update [material_issue] set [materialissue_date]=@materialissue_date,[qty]=@qty,[sno_to]=@sno_to,[sno_from]=@sno_from
[issue_to]=@issue_to,[issue_by]=@issue_by,[clientname]=@clientname,[entered_by]=@entered_by,[ptypename]=@ptypename,[invoice]=@invoice
[remarks]=@remarks where [material_issueno]=@material_issueno">
</asp:SqlDataSource>
and Error is
Line 2: Incorrect syntax near 'issue_to'.
plese tell me where is the problem
|
|
|
|
|
Aren't you missing a comma after @sno_from ?
prateekfgiet wrote: ,[sno_from]=@sno_from
[issue_to]=@issue_to,[issue_by]=@issue_by,
Scott
|
|
|
|
|
ok thanks
now its working
|
|
|
|
|
Server.MapPath("../Admin/Files/" + @"\" + ClientDet.SelectedValue +
@"\" + CurrYear + @"\" + month);
//how to give the above line path for
File_Attach.PostedFile.SaveAs(Server1Url);
Thanks in Advance...
Sorry for asking again and again
|
|
|
|
|
Odds are pretty good you've pissed people off enough that you'll never get it answered.
Jon
Smith & Wesson: The original point and click interface
Both democrats and republicans are playing for the same team and it's not us. - Chris Austin
|
|
|
|
|
Maite, there are many other good things to do than programming.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Plz say the good thing so that i can do that
|
|
|
|
|
string Server1Url= string.Format("your path here");
File_Attach.PostedFile.SaveAs(Server1Url);
Padmanabhan
|
|
|
|
|
i want to open a child datagrid in the same web form
example
i have a datagrid with columns semester , paper for a particular course
wht actually i want that when i click on hypertext column of base datagrid a child datagrid with related details to be displayed
modified on Monday, May 18, 2009 7:19 AM
|
|
|
|
|
Is that all of the problem or did your professors give you more details?
Jon
Smith & Wesson: The original point and click interface
Both democrats and republicans are playing for the same team and it's not us. - Chris Austin
|
|
|
|
|
its a simple one...
Take two grid
in the first grid if u click a row get the identity value and pass it as a values for the select query whcih will ne like"select * from table where id = //your value" and assign the datasouce for the next grid.....
Padmanabhan
|
|
|
|
|
Hello
I have a field in my database with three options (unknown, yes, no) and the database stores numbers (1,2,3) I want to replace 1,2,3 with the corresponding unknown, yes or no in a bound datagrid.
Any hints? Is it possible?
ma tju
Pengaturcara Perisian
Subang Jaya,Selangor, Malaysia
Ring Master SB MVP 2008
Subang Jaya MOP (Otai)
|
|
|
|
|
hi
after binding the datagrid
run a for loop to change text of datagrid
|
|
|
|
|
Hi,
Where should i run the for loop. what should i read and replace.
Thanks as an advanced
ma tju
Pengaturcara Perisian
Subang Jaya,Selangor, Malaysia
Ring Master SB MVP 2008
Subang Jaya MOP (Otai)
|
|
|
|
|
after binding the datagrid
If DataGrid1.Items.Count > 0 Then
For i = 0 To DataGrid1.Items.Count - 1
if UCase(DataGrid1.Items(i).Cells(columnumber).Text) ="1" Then
DataGrid1.Items(i).Cells(3).Text="Unknown"
elseif UCase(DataGrid1.Items(i).Cells(columnumber).Text) ="2" Then
DataGrid1.Items(i).Cells(3).Text="yes"
elseif UCase(DataGrid1.Items(i).Cells(columnumber).Text) ="3" Then
DataGrid1.Items(i).Cells(3).Text="no"
End If
Next
End If
|
|
|
|
|
first bind gridview with this field
use loop
for(int i=0; i<gridview1.rows.count>0: i++)
{
// now find control where u bind this field value
ex label l = (Label)(gridview1.rows[i].findControl("control_name"));
string val = l.tostring();
if(val=="1")
{
l.Text=unknown;
}
else if(val=="2")
{
l.Text=yes;
}
else
{
l.Text=no;
}
}
|
|
|
|
|
Thanks sheha. I have already settle my problem.
I insert this code in gridview_RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Or e.Row.RowType = DataControlRowType.Separator Then
Dim Idstr As String
Idstr = CType(e.Row.FindControl("lblId"), Label).Text
If Idstr = 1 Then
CType(e.Row.FindControl("lblId"), Label).Text = "Yes"
If Idstr = 2 Then
CType(e.Row.FindControl("lblId"), Label).Text = "No"
End If
End If
ma tju
Pengaturcara Perisian
Subang Jaya,Selangor, Malaysia
Ring Master SB MVP 2008
Subang Jaya MOP (Otai)
|
|
|
|
|
Best way is to write in your SQL. Use Case[^] expression.
|
|
|
|
|
Thanks navaneeth for your suggestion. I already find another way to solve my problem. Actually its hard for me to understand the article from msdn microsoft.
ma tju
Pengaturcara Perisian
Subang Jaya,Selangor, Malaysia
Ring Master SB MVP 2008
Subang Jaya MOP (Otai)
|
|
|
|
|
fileattach = Path.GetFileName(File_Attach.Value);
if (fileattach != "")
{
Server1Url = Server.MapPath("../Admin/Files/" + @"\" + ClientDet.SelectedValue +
@"\" + CurrYear + @"\" + month);
File_Attach.PostedFile.SaveAs(Server1Url);
}
when i try to upload i am getting error msg as
"Access to the path 'E:\webpages\CameoWealth\Admin\Files\today\2009\May' is denied. "
how to give this path..Is that correct?
Server.MapPath("../Admin/Files/" + @"\" + ClientDet.SelectedValue +
@"\" + CurrYear + @"\" + month);
Plz help
|
|
|
|
|
You need to provide access for ASP.NET account to that directory.
|
|
|
|
|
antony beula wrote: "Access to the path 'E:\webpages\CameoWealth\Admin\Files\today\2009\May' is denied. "
Are you sure about that? So what will be the value tomorrow? next week? next month?
|
|
|
|
|
I have used window.open() to open a pop up window.But when i run it window doesn;t have any scrollbar even I have used "scrollbars=yes" in window.open().
please guide me.....
|
|
|
|
|
Give the full code of window.open.It will help to answer
|
|
|
|
|
protected void LinkButton1_Click(object sender, EventArgs e)
{
//Response.Redirect("Registration.aspx");
LinkButton1.Attributes.Add("OnClick", "window.open('Registration.aspx',null,'Height=600;left=50;Width=30;top=50;menubar=no;toolbar=no;scrollbars=yes;resizable=no');");
}
this is the code for popup window.....
|
|
|
|