Whenever, you use textarea control in your html code, and you try to fetch the textarea data using jquery, you will encounter this 'unterminated string literal' issue.
Main reason of this issue is, while entering text in textarea control, if you press enter for new line, thus newline character is created, which make this issue to happen.
Please read below to find the solution to this issue,
suppose your html code is
HTML Code
<tr>
<td align="right">
About RJ :
</td>
<td align="left">
<asp:TextBox ID="txtaboutrj" runat="server" TextMode="MultiLine" Width="300" Height="100"></asp:TextBox>
</td>
</tr>
To avoid this issue to happen, what you have to do is, just append '.ToString().Replace(Environment.NewLine, "<br />")' to your control name in code behind, like shown below.
This will replace newline character with HTML tag "<br />",
Hope this post will help you,
if yes please put comment below of this page, Rajesh Singh,
Asp.Net Developer
Indianic Infotech Ltd (India)
rajesh@indianic.com
In this tutorail, I will teach you how to make crystal report in vb.net.
Please follow the Steps to Create Crystal Report in VB.NET,
Step 1: Create one vb.net project in visual studio.
Step 2: what we need to create simple crystal report ? a.Dataset file (.xsd) b.Crystal Report (.rpt) c.One window form (.vb)
Step 3: Right click on project name in visual studio and click on add to add new items.
Step 4: Select Dataset from the list from Add New Item displayed box. Name it as ReportDS as shown in Video. Then you will be prompt with gray screen, it shows you have created dataset properly. Drag Table from the Server explorer and drop it on dataset gray screen.
Step 5: Now its time to insert report file (.rtp), right click on project name in visual studio and click on add to add new items.
Step 6: Select CrystalReport from the list from Add new item displayed box. Name it as Crystalreport1 as shown in video. Then you will be prompt with the Crystal Reports Gallery, Just click on "OK", then another page "Standard Report creation Wizard" will be prompted. Then you need to select the database you created, in step 4. For that click on ADO.NET Dataset and select you dataset from the list.as shown in video. Then you will be prompted with table with fields, select the fields you require to show in report. Then click on finish, and you have done.
Step 7: Now you need to add from to show this report in it. To do that, just add new form (.vb), and drag the Reportviewer form the data section in tool box.
Step 8: Take one button in that from, so that, when you click on that button, the report show appear.
Step 9: Then on click event of that button, paste this code below.
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=PAMDB.mdb;User Id=admin;Password=;") Dim cmd As OleDbCommand cmd = New OleDbCommand("SELECT PAM_Medical_Information.tPatientName, PAM_Medical_Information.tDoctorCareProvider, PAM_Type_of_Medical_Entry.tMedicalTypeName, PAM_Medical_Information.tRx_OTC_MedsList_Dosage_Frequency, format(PAM_Medical_Information.dMedicalDate,'MM/dd/yyyy') as dMedicalDate , iif (PAM_Medical_Information.tPutOnMedicalInformationCard = '1', 'Yes', 'No') as tPutOnMedicalInformationCard FROM PAM_Medical_Information INNER JOIN PAM_Type_of_Medical_Entry ON PAM_Medical_Information.nMedicalTypeID = PAM_Type_of_Medical_Entry.iMedicalTypeID", conn) ' Change ID
Dim da As New OleDbDataAdapter(cmd) Dim ds As New DataSet() 'Set TypeDataset name That I have created before da.Fill(ds, "MedicalList") If (ds IsNot Nothing And ds.Tables(0).Rows.Count > 0) Then Dim cryRpt1 As New ReportDocument Dim reportpath As String = Application.StartupPath & "\Reports\Medical.rpt" 'cryRpt1.Load(reportpath) cryRpt1.Load(reportpath) cryRpt1.SetDataSource(ds.Tables(0)) CrystalReportViewer1.ReportSource = cryRpt1 CrystalReportViewer1.Refresh() End If
Thats it, you have done finally, enjoy the report.
Hope this post will help you, if yes please put comment below of this page, Rajesh Singh, Asp.Net Developer Indianic Infotech Ltd (India) rajesh@indianic.com
Create one Static class and declare static member/property into that class.
Now you can access that variable from any form in your windows application. Also you can able to set and get variable values.
GlobalModule Class:
using System; using System.Collections.Generic; using System.Linq; using System.Text;
static class GlobalModule {
private static string _GlobalVar = ""; public static string GlobalVar { get { return _GlobalVar; } set { _GlobalVar = value; } }
public static string FirstName = "Rajesh"; }
How to use global variables in application:
//Set the value to static variable GlobalModule.GlobalVar = "VB.Net C#";
//Get the value from static variable string CheckVal = GlobalModule.GlobalVar; string FirstName = GlobalModule.FirstName;
Hope this post will help you, if yes please put comment below of this page, Rajesh Singh, Asp.Net Developer Indianic Infotech Ltd (India) rajesh@indianic.com
Public Class DAL Dim ConnStr As String = Configuration.ConfigurationSettings.AppSettings("DBConn").ToString()
Public Function ExecuteNonQueryGetIdentity(ByVal Query As String) As Integer
Dim iResult As Integer Try Dim Conn As New OleDb.OleDbConnection(ConnStr) Conn.Open() Dim cmd As New OleDb.OleDbCommand(Query, Conn)
cmd.ExecuteNonQuery() cmd.CommandText = "Select @@Identity" iResult = cmd.ExecuteScalar() Conn.Close() cmd.Dispose() Catch ex As Exception ex = Nothing End Try
Return iResult End Function
End Class
After insert operation, when you will check the value of return value of iRelationID, you will find the inserted row id.
Hope this post will help you, if yes please put comment below of this page, Rajesh Singh, Asp.Net Developer Indianic Infotech Ltd (India) rajesh@indianic.com
Please find below code, which will help to find all file in perticular folder and delete all the file and make folder blank.
Explaination of the code : Delete all image file from Perticular folder in C#
Here, i have find the folder path using Server.MapPath, then stored all the file in the array, i have named it imglist.
Then i have used forloop to get all the files name one by one and delete it, Here i have taken DateTime.Now.AddMinutes, because if the file is added just before 3 minutes from the current time, then it should not be delete, you can change the time according to your need.
Hope this post will help you, if yes please put comment below of this page, Rajesh Singh, Asp.Net Developer Indianic Infotech Ltd (India) rajesh@indianic.com