|
i have a table emp.where the coloumns are
emp_id,emp name and address.
and onother table named as emp_details
where the coloumns are.
empid,emp_sex,emp_age,emp_bloodgroup.
now i am populating the data of emp in the gridview1 where "auto generate select button is true".
whenever i will select the record of any employee.the corresponding empid of that column should display in the "textbox2" show that
i can enter the other data for emp_details(where the other text boxes are there to enter age,sex and blood_ group).
canyou tellme what code i wil write for it(in vb.net)
|
|
|
|
|
Loop through the all the Items in datagrid and Set the onclick attribute to the link button of grid, and then call any procedure through Javascript, which assigns the value to textbox.
Code for settting onclick attribute to datagrid.
Dim LnkBtn As New System.Web.UI.WebControls.LinkButton
LnkBtn = datagrid1.Items(i).Cells(0).FindControl("lnkSelect")
LnkBtn.Attributes.Add("onclick", "Write the Javascript Code Or Call local Javascript Procedure")
Script for Setting value to TextBox.
document.all('textbox1').value = datagrid1.Item(RowId).cells(ColID).text>
Bhaskar Shetty
|
|
|
|
|
hi guyz
again i need ur help.
i have a table emp.where the coloumns are
emp_id,emp name and address.
i am storing the data to "emp" table from the frontend throgh storepocedure.there is a "check" button, in which i want to check the data from the database based up on the empid.
i want to check if there is any record based up on the empid from emp table.it should give a message that "one reocrd found" .
where i am entering the empid in the "textbox1.text".what will be code for it in "vb.net"
|
|
|
|
|
In Stored Procedure,
"SELECT COUNT(*) FROM emp WHERE emp_id = @empID
Use SqlCommand or OledbCommand to execute the stored procedure. Get the return value and show it to the user.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
are u taking about how to execute sp in dotnet.
here code in C#
setting = ConfigurationManager.ConnectionStrings["databaseConnectionString"];
if (setting != null)
{
conn = new SqlConnection(setting.ConnectionString);
cmd = new SqlCommand("Sp_Category_check");
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@cateid", SqlDbType.VarChar);
cmd.Parameters["@cateid"].Value = DropDownList1.SelectedValue;
conn.Open();
cmd.Connection = conn;
try
{
rdr = cmd.ExecuteReader();
if (rdr.Read())
{
//here your message comes
}
}
catch (SqlException ex)
{
Response.Write(ex.ToString());
}
finally
{
if (rdr != null)
{
rdr.Close();
}
if (conn != null)
{
conn.Close();
}
}
imaran khan
|
|
|
|
|
Dear All,
I am trying to use the asp.net menu control in order to create a horizontal menu made up of images.
I have a table which has 3 columns and 1 row. the first cell is used to hold an image that does not have to do with the menu, the second cell holds a table that contains the menu while the third cell contains another independent image. All cellpadding and cellspacing and border are set to 0.
Now what is happening is that the menu cell is leaving a margin at the top of arount 1 or 2 pixels. All the images used in the row are the same height even the other images that do not have to do with the menu.
Everthing looks fine in mozilla! the problem is with IE
Anyone has ever encountered this?
Thanks a lot,
Chris Farrugia
|
|
|
|
|
Hi All,
Could anyone please help me out in auto-generating a property in a class in a following format:
public System.Int64 RollNumber
{
get
{
System.Int64 rollNo = (System.Int64 )this["@roll_number"];
return rollNo;
}
}
I am able to generate the property with the return statement and the other stuff, but i am not able to Generate the assignment statement i,e :
System.Int64 rollNo = (System.Int64 )this["@roll_number"];
Please Help.
Thanks,
Ramesh
|
|
|
|
|
I have created a user control that contains All Fields Like Address textbax
City Text box , State drop down ,zip code Textbox
Now State Drop downlist is another user control(different dll) that i am using into that
Now problem i am getting that on first page the drop down is prepopulating the All the list of states but after that is not can anyone tell What might be reasone ?
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... "
|
|
|
|
|
Hi friends
I want to know Which method is used in c# for InStr method which is used in VB.
VB Sample code
If Not InStr(1, Site.BarredFolders, Path.GetFileName(subdirectory), vbTextCompare) > 0 Then
Thanks In advance
Pathan
---------------------------------------------------
|
|
|
|
|
Imran Khan Pathan wrote: InStr
String.IndexOf() ??
Actually, there are methods like "str.Substring()" in C#. You have to do some experiments to get the result what you want.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Stuff like InStr is best avoided, if you're using VB.NET. Use the same stuff you'd use in C#.
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 )
|
|
|
|
|
It's the IndexOf method on the string class.
However, be warned that result is 0-based while the legacy VB method is 1-based.
David Anton
http://www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
C++ to C# Converter: converts C++ to C#
C++ to VB Converter: converts C++ to VB
C++ to Java Converter: converts C++ to Java
Instant C++: converts C# to C++/CLI and VB to C++/CLI
|
|
|
|
|
Hi All,
I have used CodeDOM in .net to auto-generate C# code, which in essence generates a class file having a class along with its member fields, methods and properties.
However, i don know how to generate the following line of code:
private const string NAME = "CSharp";
Here, i have a generate a CodeMemberField which is a constant string with a private specifier as shown above.
Please send me the sample code which would help me to auto-generate the above line of code.
|
|
|
|
|
hi,
in my asp.net web application, I insert, update and delete records in an access database..I do that by creating a connection, an adaptor and so on everytime I wanna do any of these things...is there a better way to do these functions without doing this everytime. what's the best way to handle database transactions in my web application in order to make the application faster and optimize its performance??
|
|
|
|
|
Dear all,
I am using asp.net , C# , sql 2005.
I would like to present column wise detail(like gridview present row wise presentation). I manipulate my query to show three column per row (using cursor).
As my query is dynamic I decide at run time which field to show.
Please give me some idea like which web control I use to show column wise record in dynamic case.
Please guide me
thanks
imaran khan
|
|
|
|
|
Hi friends
what is sqldependency?
regards
saravan
|
|
|
|
|
|
I am storing images into database using serialization. while displaying those images into gridview control how to assign them to image button of gridview control?
|
|
|
|
|
I think you need to first convert them bitmap or similar to that you can't aasign directly yo any control first convert them stream into some meaning full image type
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... "
|
|
|
|
|
Thanx..do u have any url for dis?
|
|
|
|
|
|
Hi,
Can any one tell me how to export data from gridview to pdf?
I have tried with the following piece of code:
Response.ClearContent();
Response.AddHeader("content-disposition", "attachment; filename=Report.pdf");
Response.ContentType = "application/pdf";
StringWriter objStrWriter = new StringWriter();
HtmlTextWriter objHtmlTxtWriter = new HtmlTextWriter(objStrWriter);
grdvwReport.RenderControl(objHtmlTxtWriter);
Response.Write(style); // Set the currency columns style
Response.Write(objStrWriter.ToString());
Response.End();
But while opening the pdf iam geeting the follwing message:
AdobeReader could not open 'Report[1].pdf' because it is either not a supported file type or because the file has been damaged.
Please try to help me...
Thanks in advance
Sumithra
|
|
|
|
|
|
Hi,
I have already tried with that code.But while opening iam getting the error. Is there any other way to convert data from gridview to pdf?
Thanks
|
|
|
|
|
Hi
i read the html code and html controls into one protected string, i put that server tag into html source. but my problem is i am not able to finding html controls . this is my code
For cnt = 0 To listofobj.Count - 1
If listofobj(cnt).MNU_Imgpath = "" Then
listofobj(cnt).MNU_Imgpath = "Noimg.jpg"
End If
Dim dupchk As Boolean = dupeliminate(listofobj(cnt).MNU_MenuID)
If dupchk = True Then
str &= ""
str &= "" & vbCrLf
str &= " " & vbCrLf
str &= listofobj(cnt).MNU_MenuName
str &= " " & vbCrLf
str &= " " & vbCrLf
End If
str &= "" & vbCrLf
str &= "" & vbCrLf
str &= " " & vbCrLf
str &= " " & vbCrLf
str &= "" & vbCrLf
str &= " " & vbCrLf
str &= " " & vbCrLf
str &= " " & vbCrLf
str &= " " & vbCrLf
str &= " " & vbCrLf
str &= " "
str &= " " & vbCrLf
str &= " " & vbCrLf
str &= " " & vbCrLf
str &= "" & vbCrLf
str &= " " & vbCrLf
str &= " | " & vbCrLf
str &= " " & vbCrLf
str &= " | " & vbCrLf
str &= " " & vbCrLf
str &= " " & listofobj(cnt).MNU_ItemName & "
" & vbCrLf
str &= " " & listofobj(cnt).MNU_Desc & "
" & vbCrLf
str &= " Item Availabale From" & listofobj(cnt).MNU_StartTime & " to " & vbCrLf
str &= " " & listofobj(cnt).MNU_EndTime & ""
str &= " | "
str &= " " & vbCrLf
str &= " Price:" & listofobj(cnt).MNU_Price & " " & vbCrLf
str &= " | " & vbCrLf
str &= " Quantity:" & vbCrLf
str &= " " & vbCrLf
str &= " 1" & vbCrLf
str &= " 2" & vbCrLf
str &= " 3" & vbCrLf
str &= " 4" & vbCrLf
str &= " 5" & vbCrLf
str &= " 6" & vbCrLf
str &= " 7" & vbCrLf
str &= " 8" & vbCrLf
str &= " 9" & vbCrLf
str &= " 10" & vbCrLf
str &= " 11" & vbCrLf
str &= " 12" & vbCrLf
str &= " 13" & vbCrLf
str &= " 14" & vbCrLf
str &= " 15" & vbCrLf
str &= " 16" & vbCrLf
str &= " 17" & vbCrLf
str &= " 18" & vbCrLf
str &= " 19" & vbCrLf
str &= " 20" & vbCrLf
str &= " " & vbCrLf
str &= " | " & vbCrLf
str &= " | " & vbCrLf
str &= ""
Next
this string results a grid view format table.
grid view not satisfy my requirement because i want full rows in middle.
the tag is running good showing the items properly. but when i click add the item to cart. i need to be find the html controls which i written in server tag. but i am not able to find it.
dim itemid as new htmlinputcheckbox
itemid = ctype(page.findcotrol("enabled0"),htmlinputcheckbox)
the itemid showing nothing eventhough i have that control....... why ???
is there any other procedure to find the dynamic html control rather than the page.findcontrols...........
example:
pizza
----------------------------------
pizzaimg1 description cost quantity
pizzaimg1 description cost quantity
pizzaimg2 description cost quantity
pizzaimg3 description cost quantity
salad
pizza
----------------------------------
salad1 description cost quantity
salad2 description cost quantity
salad3 description cost quantity
like so on ................
i am assigning the source as array list with generic list of(...)
Hope that any body help me...........
This is haneef.............................................................
This is haneef.............................................................
|
|
|
|