|
Yeah, you could probably use .Split on the underscore:
string db = "jh00~pr11_01";
string[] split = db.Split('_');
string s_number = split[1];
int i_number = Int32.Parse(s_number);
i_number++;
s_number = i_number.ToSrting();
db = split[0] + "_" + s_number;
There's probably stuff wrong with that code, but you get the idea.
Separate the number from the rest of the string, increment it, and add it back on.
My current favourite word is: Bauble!
-SK Genius
|
|
|
|
|
thats great thanks
how would i make it 02 on the end instead of just 2 as its doing at the mo?
cheers!!
|
|
|
|
|
of course, use .PadLeft(2, '0'); which will add 0's to the start until the length of the string is 2
My current favourite word is: Bauble!
-SK Genius
|
|
|
|
|
On invoking the form that contains the Datagrid view the DataGridView Default Error Dialog appears...
I am unable to handle this event. Can anyone tell how to prevent this dialog from appearing.
|
|
|
|
|
I am pretty sure there has to be a method after that.
but i dont no if that is write.
ollie
|
|
|
|
|
Thank you ollie for your reply...
I have resolved the problem...
Using the DataGridView.DataError event and catching the exact error worked out...
modified on Friday, December 07, 2007 7:46:56 AM
|
|
|
|
|
|
Hi,
Is is possible to read all class name from a assembly.
USing reflection i can read class name and all other inforamtion of it. but i want to get the class name from some other Csproj file so i need to read the assembly of that file !!!!
Any idea !!!!
Thanks in advance !!!!
|
|
|
|
|
Abhijit Jana wrote: Is is possible to read all class name from a assembly.
Yes. From the Assembly object you can use the GetTypes() method which returns an array of Type objects.
Abhijit Jana wrote: but i want to get the class name from some other Csproj file so i need to read the assembly of that file !!!!
Yes, you can use one of the static Load methods on Assembly. If you only want to query the assembly without running code on it you can use one of the ReflectionOnlyLoad methods instead.
|
|
|
|
|
|
(for example)
Type _type = Assembly.GetAssembly(this.GetType()).GetType("class name");
or
Type[] array = Assembly.GetAssembly(this.GetType()).GetTypes();
|
|
|
|
|
Hi,
I am building a windows application that can show list of files from a folder that is placed in web site. I mean to say on web server. Let us suppose there is a folder on localhost named as Test. Now i want to display all files' mame in a list view. Is there anybody has any helping material that can help me as well. Thanks in advance
|
|
|
|
|
|
I've tried this one but this is only for local system. But i want to fetch the files from a folder placed on Web Server to a local system. I can read files as stream but how can i get the list of file from a folder placed in a web site.
|
|
|
|
|
|
hi.. if i create project using wpf.. drag a button into the form.. how do i get to the event for the button_click ? i cant double click tat...
|
|
|
|
|
Hi,
You can just add eventhandler for the button in code-behind file as follows :
button1.Click += new RoutedEventHandler(button1_Click);
Regards,
Ujjaval Modi
|
|
|
|
|
where is the code behind the file? where to put the code?
wht i was forced to do is open the blend.. and get click on the event button click to show the code.. hahaha
|
|
|
|
|
|
Hi,
iam doing windows application with c#..
i have to insert datagridview rows into database...
with my code data is inserting into database and at the same
time it is giving error ("unhandled datatype mismatch")
i check with all my database datatypes and text what iam typing.
so please provide some help..
mycode is
string connection = @"Provider=Microsoft.Jet.OLEDB.4.0;" +
@"Data source= D:\inventory\management\management\database\muralicell.mdb";
OleDbConnection myconnection = new OleDbConnection(connection);
myconnection.Open();
for (int i = 0; i < inwardgrid.Rows.Count; i++)
{
string insproducts = "INSERT INTO product_details(productid,Invoice_number,productname,units,received_date)VALUES('" + inwardgrid.Rows[i].Cells[0].Value + "','" + inwardinvno.Text + "','" + inwardgrid.Rows[i].Cells[1].Value + "','" + inwardgrid.Rows[i].Cells[2].Value + "','" + inwardrecdate.Text + "')";
OleDbCommand insprocommand = new OleDbCommand(insproducts, myconnection);
insprocommand.ExecuteNonQuery();
insprocommand.Dispose();
}
myconnection.Close();
murali krishna
|
|
|
|
|
Hi,
Just try to put your code in try & catch block. Because you are getting datatype mismatch error. The conflict is between the data you are passing and the data-type of the fields in database.
May be error is due to date field.
Regards,
Ujjaval Modi
|
|
|
|
|
hi all
help me how to code in c# to
pass the texbox values present in form1
to form2 for a button click event
.
i had coded lik this ina button click of form1
private void btnEdit_Click(object sender, EventArgs e)
{
frm2.Show();-----i had created frm2 object above this click event
frm2.TextBox1=txtAreaName.Text;----> this code doesnt works. i mean here to pass the textbox value of form2 to textbox in form1.
}
pls help
thank you
senthil
|
|
|
|
|
There are many ways to acheive this, the easiest is to adjust the constructor for form2 to accept a textbox argument and store that as a variable in the form2 class in the constructor. Then you can access or change any of the form1.textbox properties from form2.
|
|
|
|
|
|
Hi,
I am working on the Ado.Net Entity Framework and I want to know the how it is best over the Ado.net considering the performance.
Thanks,
Sarang
|
|
|
|