pritesh2010 30 Posting Whiz in Training

see this link it might be help you to host calender column in Datagridview
Msdn
and Click to see Example

pritesh2010 30 Posting Whiz in Training

see the below screenshot which solve your problem

vodkasoda commented: Guided me straight to the problem ... +1
pritesh2010 30 Posting Whiz in Training

see the below example which can be help you. it's a just example just write your own code.

ex:- string str = "a,b,b,c,c,d,d,e,e,f,f,g,g,h,h,i,i,j,j,k,";
//now i want to split with the evry 2 comma
//so my o/p should be display like this
a,b
b,c
c,d
d,e
e,f
f,g
g,h
i,j
j,k
		for(int t=0;t<str.Length;t+=4)
		{
			if(t==str.Length){ break;}
			console.WriteLine((str.Substring(t,3) +"\n");
		}
ddanbe commented: helpfull. +15
pritesh2010 30 Posting Whiz in Training

on click of btn bold make btn font style bold

private void btnbold_Click(object sender, EventArgs e)
        {
            if (btnbold.Checked)
            {
                btnbold.Checked = false;
                btnbold.CheckState = CheckState.Unchecked;
                btnbold.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular);
            }
            else {
                btnbold.Checked = true;
                btnbold.CheckState = CheckState.Checked;
                btnbold.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold);
            }
        }
Behseini commented: Perfect solution +3
pritesh2010 30 Posting Whiz in Training

huunnn. first create a instance of your login form.when application satrted first it will show the main form and login form will be visible so on form load event.

login lg =new login();
Private Void MDIFOrm_load()
{
lg=new login();
lg.MdiParentForm=this;\\means it will appear in MDI paren form
lg.show();
}

on login form button write this code

private void button_click()
{
\\if user successfully login then
lg=new login();
lg.Hide();
form f=new form();
f.MDIparent=this;\\ or write your Main mdi form name.
f.show();

}

try this it will work.

pritesh2010 30 Posting Whiz in Training

Properties provide the opportunity to protect a field in a class by reading and writing to it through the property. C# properties enable this type of protection while also letting you access the property just like it was a field.
Becuase of get /set our class contains control over the input.
let say E.g. if you don't need to use get/set. you colud write function for setfunct or getfunct insted of using Property.

Class myclass
{   
   int32 x,y;
    Public my(int32 x,int32 y)
      {
       this.x=x;
       this.y=y;
      }
     public int getnumberx()
      { return x; }
      public Void setnumberx (int x)
       { this.x=x; }
     public int getnumbery()
      { return y; }
      public Void setnumbery (int y)
       { this.y=y; }
}

But that's a real problem like -- you'd rather write myc1.Y = 3; and be able to write things like myc1.Y += 5; , instead of myc1.SetY(myc1.GetY() + 5); .
//where myc1 is a object of class
So instead C# has properties:

Class myclass
{   
   int32 x,y;
    Public my(int32 x,int32 y)
      {
       this.x=x;
       this.y=y;
      }
     public int getnumberx()
       get { return x; }
       set { x=Value; }
     public int getnumbery()
       get { return y; }
       set { y=value; }
}

Inside the setter, the keyword 'value' is the variable containing the value that is getting assigned to the property setnumberY.

Reason we use properties is it's a virtual.Another benefit of properties over fields is that you can change their internal implementation over time. With a public …

Geekitygeek commented: well written example +1
Duki commented: Excellent detail +7
pritesh2010 30 Posting Whiz in Training

this will help you for lgoin form. on button click write this code

con = New SqlConnection(cons)
        con.Open()
        str = "Select [UserName], [Password] from [UserLogin] "
        cmd = New SqlCommand(str, con)
        Dim dr As SqlDataReader
        dr = cmd.ExecuteReader()
If dr.HasRows = True Then
            While (dr.Read())
                If dr(1).ToString() = Trim(txtuname.Text) And dr(2).ToString() = Trim(txtpass.Value) Then
Session.Add("Username", TextBox1.Text)     
Session.Add("Password", TextBox2.Text)
Exit While
                End If
            End While
            Response.Redirect("Home.aspx")
            Exit Sub

        ElseIf dr.HasRows = False Then
            MsgBox("Invalid User Name OR Passward")
            cmd = Nothing
            con.Close()
            Response.Redirect("MHome.aspx")
       End If

if this will solve your ans then mark your thread as solved. :)

pritesh2010 30 Posting Whiz in Training

yes first put the gridview on your form. then on button click event write the code.

pritesh2010 30 Posting Whiz in Training

so you want hyperlink on your gridview. and when you click it should be redirect to other page.
after auto generate column false. Add a template filed in your gridview. This will you get from click on smart tag of grid. gor to Edit Column. And ther is available filed add one Template field.
After adding field go to the Edit Tamplate of gridview and add a hyperlink at ther in Itemtamplate.
after adding hyperlink bind the hyperlink with text and navigationUrl.
for e.g. you can see this in source code

<asp:HyperLink ID="HyperLink2" runat="server" Font-Bold="True" ForeColor="Red" Text='<%# Eval("Title", "{0}") %>'
                                                         NavigateUrl='<%# "~/Default.aspx?id=" & Container.DataItem("TitleID") %>' Width="306px"></asp:HyperLink>

it means hyperlink shows the name of the link and it will navigate based on the link Id number. or if you daon't want that Id then simply write your url i.e. NavigateUrl=""~/Default.aspx".
both will working. if problem is solved mark thread as solved.

AngelicOne commented: thanks, i'll try this +1
pritesh2010 30 Posting Whiz in Training

for that first create aconnection with the database. Then create one Adapter and fire a querry in your adpter and fill the dataset with adapter and give your gridview datasource that dataset.
e.g.

OleDbConnection con=new OleDbConnection ("Connection String");
Con.OPen();
string str="Select [name] from [tabel] Where [name] like '%" + textbox1.Text + "%'";
OleDbDataAdapter da=new OleDbDataAdapter (str,con);
Dataset ds=new Dataset();
da.Fill(ds,"table");
mygrid.DataSource=ds;
''mygrid.DataMember="table" ''sorry i'm not sure about this property
''but other then all the code is right
con.close();

try it.

pritesh2010 30 Posting Whiz in Training

Thank you sir for Replaying I got the soltion here is my code for that i think this will help other also.
as per you firsttold i had created neasted Repeater and then on form load i'ed written this code for that

protected page_load
dim da as new sqlDataAdpter("Select* from [table1];Select* from [Table2]",con)
dim ds as new dataset
da.fill(ds)
ds.Relations.Add("name",ds.Tables(0).Columns("ID"),ds.Tables(1).Columns("ID"))
 Repeater1.DataSource = ds
 Repeater1.DataBind()
end sub
Protected Sub Repeater1_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.RepeaterItemEventArgs) Handles Repeater2.ItemDataBound
        Dim dv As DataRowView = TryCast(e.Item.DataItem, DataRowView)
        If dv IsNot Nothing Then
            Dim rpt As Repeater = TryCast(e.Item.FindControl("childrpt"), Repeater)
            If rpt IsNot Nothing Then
                rpt.DataSource = dv.CreateChildView("name")
                rpt.DataBind()
            End If

        End If
    End Sub

and it works.

Lusiphur commented: Nicely done! I was too tired to work it through that far last night :) +1
pritesh2010 30 Posting Whiz in Training

hii prashant20,
no need to use two connection you can do this one connection like when you clik save button that time first save your Exam table data.

sqlconnection con =new sqlconnection("connection string");
con.open();
try
{
sqlcommand cmd=new sqlcommand("your insert query",con);
cmd.ExecutenonQuery();
cmd.dispose();
Sqlcommand cmd=new sqlcomman("another insert query",con);
cmd.ExecutenonQuery();
con.close
Messagebox.Show("Data inserted");
}
Catch(Exception ex)
{
MessageBox.Show(ex.Message.Tostring)
}
pritesh2010 30 Posting Whiz in Training

simple fire a query on on Radiobutton_checkedChanged event.
show some code.

pritesh2010 30 Posting Whiz in Training

see this link will help you Codeproject

Lusiphur commented: Good Link :) +1
pritesh2010 30 Posting Whiz in Training

hey friend why are you doing this much coding for crystal report
try

I would like to suggest you to use Push model to design crystal reports.

pritesh2010 30 Posting Whiz in Training

i had attached the zip file for what i had done in login system pleas see that

pritesh2010 30 Posting Whiz in Training

to valid textboxes write the code in keypress event
like

private sub textbox1_keypress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles  textbox1.KeyPress
Dim KeyAscii As Integer
        KeyAscii = Asc(e.KeyChar)
        Select Case KeyAscii
case 65 to 90 ''for capital ALPHABET A
case 97 to122
case else
keyascii=0
End Select

        If KeyAscii = 0 Then
            e.Handled = True
            MessageBox.Show("Please Type Word  only", "Type the Numbers!", MessageBoxButtons.OK, MessageBoxIcon.Error)
        Else
            e.Handled = False
        End If

end sub

it's simple
try it will run